Hello,
I am new to Python. I am learning boxsizers.
How do I place two buttons, one at the top right corner and another one
at bottom right corner in a panel? I am using Python 2.7.6 and wxPython
2.8.12.1.
Thanks!
Hello,
I am new to Python. I am learning boxsizers.
How do I place two buttons, one at the top right corner and another one
at bottom right corner in a panel? I am using Python 2.7.6 and wxPython
2.8.12.1.
Thanks!
Hi,
btn_sizers.py (1.32 KB)
On Thursday, November 6, 2014 10:50:12 AM UTC-6, Joydeep Chakrabarty wrote:
Hello,
I am new to Python. I am learning boxsizers.
How do I place two buttons, one at the top right corner and another one
at bottom right corner in a panel? I am using Python 2.7.6 and wxPython
2.8.12.1.Thanks!
Welcome to the world of Python. There are several approaches to getting what you want. You can mess around with the Boxsizer’s built-in Spacer methods or you can just fake the spacers using a tuple. I typically go with the latter as I can use the tuple to control how much space I want. In this case, it doesn’t really matter as I’m going to set the proportion to 1 and add the wx.EXPAND style flag. See the attached example for how it’s actually done.
You might find the following articles helpful too:
http://wxpython.org/Phoenix/docs/html/Sizer.html
http://wiki.wxpython.org/BoxSizerTutorial
http://wiki.wxpython.org/BoxSizerFromTheGroundUp
Joydeep Chakrabarty wrote:
I am new to Python. I am learning boxsizers.
How do I place two buttons, one at the top right corner and another one
at bottom right corner in a panel? I am using Python 2.7.6 and wxPython
2.8.12.1.
If you have very specific placement requirements like that, it's
entirely possible that box sizers are not the right answer for you.
There are other choices, like the FlexGridSizer
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
MODE READER
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
On Thu, 06 Nov 2014 09:23:13 -0800, Mike Driscoll wrote:
Hi,
On Thursday, November 6, 2014 10:50:12 AM UTC-6, Joydeep Chakrabarty > wrote:
Welcome to the world of Python. There are several approaches to getting
what you want. You can mess around with the Boxsizer's built-in Spacer
methods or you can just fake the spacers using a tuple. I typically go
with the latter as I can use the tuple to control how much space I want.
In this case, it doesn't really matter as I'm going to set the
proportion to 1 and add the wx.EXPAND style flag. See the attached
example for how it's actually done.- Mike
Thanks!
The code helped me a lot. But I needed the top button to be at top-right
corner. It remains at top left corner.
Thanks again.
I figured it out. Thank you all for the help.
box.py (980 Bytes)
On Friday, November 7, 2014 12:02:38 AM UTC+5:30, Tim Roberts wrote:
Joydeep Chakrabarty wrote:
I am new to Python. I am learning boxsizers.
How do I place two buttons, one at the top right corner and another one
at bottom right corner in a panel? I am using Python 2.7.6 and wxPython
2.8.12.1.If you have very specific placement requirements like that, it’s
entirely possible that box sizers are not the right answer for you.
There are other choices, like the FlexGridSizer–
Tim Roberts, ti...@probo.comProvidenza & Boekelheide, Inc.
O
On Thu, 06 Nov 2014 09:23:13 -0800, Mike Driscoll wrote:
Hi,
On Thursday, November 6, 2014 10:50:12 AM UTC-6, Joydeep Chakrabarty > > > wrote:
Welcome to the world of Python. There are several approaches to getting
what you want. You can mess around with the Boxsizer’s built-in Spacer
methods or you can just fake the spacers using a tuple. I typically go
with the latter as I can use the tuple to control how much space I want.
In this case, it doesn’t really matter as I’m going to set the
proportion to 1 and add the wx.EXPAND style flag. See the attached
example for how it’s actually done.
- Mike
Thanks!
The code helped me a lot. But I needed the top button to be at top-right
corner. It remains at top left corner.Thanks again.
You can change the code a bit to add a spacer before adding the top button so that it gets shifted to the right. Just do what I did with the bottom button.
Mike