Hello users,
I am having an issue implementing the wx.NO_BORDER style with frames. I’ve recreated my issue with the attached samples, WithBorder.py is what the app should look like, and WithoutBorder.py is using the style=wx.NO_BORDER.
When I run the WithoutBorder.py file, all of the widgets get jammed into the default position in the upper left corner.
Is this an issue with my sizers, or the NO_BORDER call, or am I completely off?
When I run the WithoutBorder.py file, all of the widgets get jammed into the
default position in the upper left corner.
On OS-X wxpython 2.9.4.0 Cocoa, I get a blank Frame when I run WithoutBorder.
But both of them are too big for my laptop screen – when I change the initial size of the frame to (1000,600) it seems to work fine withoutborder. Odd, and probably a platform difference.
you might try a:
panel.SetSizerAndFit(gbs)
and/or
self.Layout()
to force a layout – these don’t break anything for me, but hard to tell if they will help, as I don’t have the problem in this platform.
HTH,
-Chris
Is this an issue with my sizers, or the NO_BORDER call, or am I completely off?
Thanks for your help,
-Jake
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
Sorry about that, should have mentioned the environment – Windows 7, python27 (32bit), wx version 2.8.12.1
Interesting…
On Mon, Oct 14, 2013 at 1:42 PM, Jake Larrimore
When I run the WithoutBorder.py file, all of the widgets get jammed into the
default position in the upper left corner.
On OS-X wxpython 2.9.4.0 Cocoa, I get a blank Frame when I run WithoutBorder.
But both of them are too big for my laptop screen – when I change the initial size of the frame to (1000,600) it seems to work fine withoutborder. Odd, and probably a platform difference.
you might try a:
panel.SetSizerAndFit(gbs)
This does help a little bit, but the widgets are still not taking up the entire space allotted to it by the sizers. It’s definitely an improvement though.
Is anybody else seeing this on a windows 7 machine?
···
On Tuesday, October 15, 2013 12:47:16 AM UTC-4, Christopher Barker wrote:
and/or
self.Layout()
to force a layout – these don’t break anything for me, but hard to tell if they will help, as I don’t have the problem in this platform.
HTH,
-Chris
Is this an issue with my sizers, or the NO_BORDER call, or am I completely off?
Thanks for your help,
-Jake
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
I’m seeing the same behavior on Windows 7 with Python 2.6.6 and wxPython 2.8.12.1. I also tried it with Python 2.7 and wxPython 2.9.4 with the same result.
Mike
···
On Tuesday, October 15, 2013 6:39:43 AM UTC-5, Jake Larrimore wrote:
Sorry about that, should have mentioned the environment – Windows 7, python27 (32bit), wx version 2.8.12.1
On Tuesday, October 15, 2013 12:47:16 AM UTC-4, Christopher Barker wrote:
Interesting…
On Mon, Oct 14, 2013 at 1:42 PM, Jake Larrimore
When I run the WithoutBorder.py file, all of the widgets get jammed into the
default position in the upper left corner.
On OS-X wxpython 2.9.4.0 Cocoa, I get a blank Frame when I run WithoutBorder.
But both of them are too big for my laptop screen – when I change the initial size of the frame to (1000,600) it seems to work fine withoutborder. Odd, and probably a platform difference.
you might try a:
panel.SetSizerAndFit(gbs)
This does help a little bit, but the widgets are still not taking up the entire space allotted to it by the sizers. It’s definitely an improvement though.
Is anybody else seeing this on a windows 7 machine?
Good to know Mike, the double check is appreciated. As a temporary solution, I did a panel.SetSizerAndFit(gbs) and then self.Maximize() at the end. This gives the desired look and layout for my implementation, but it’s really a temporary workaround. I doubt that solution would work in many other situations.
It’s odd that if you resize the frame after setting the sizer with self.Maximize(), the sizer takes up the entire space of the frame as desired. However, self.Refresh() doesn’t help, nor does self.Layout().
-Jake
···
On Tuesday, October 15, 2013 9:43:15 AM UTC-4, Mike Driscoll wrote:
On Tuesday, October 15, 2013 6:39:43 AM UTC-5, Jake Larrimore wrote:
Sorry about that, should have mentioned the environment – Windows 7, python27 (32bit), wx version 2.8.12.1
On Tuesday, October 15, 2013 12:47:16 AM UTC-4, Christopher Barker wrote:
Interesting…
On Mon, Oct 14, 2013 at 1:42 PM, Jake Larrimore
When I run the WithoutBorder.py file, all of the widgets get jammed into the
default position in the upper left corner.
On OS-X wxpython 2.9.4.0 Cocoa, I get a blank Frame when I run WithoutBorder.
But both of them are too big for my laptop screen – when I change the initial size of the frame to (1000,600) it seems to work fine withoutborder. Odd, and probably a platform difference.
you might try a:
panel.SetSizerAndFit(gbs)
This does help a little bit, but the widgets are still not taking up the entire space allotted to it by the sizers. It’s definitely an improvement though.
Is anybody else seeing this on a windows 7 machine?
I’m seeing the same behavior on Windows 7 with Python 2.6.6 and wxPython 2.8.12.1. I also tried it with Python 2.7 and wxPython 2.9.4 with the same result.
Hello users,
I am having an issue implementing the wx.NO_BORDER style with frames.
I've recreated my issue with the attached samples, WithBorder.py is what
the app should look like, and WithoutBorder.py is using the
style=wx.NO_BORDER.
When I run the WithoutBorder.py file, all of the widgets get jammed into
the default position in the upper left corner.
Is this an issue with my sizers, or the NO_BORDER call,
Yes. (Both of them, sorta.)
When there is no border then there is no extra EVT_SIZE event when the frame is shown, and since you set its size before the sizer is set, then there is no EVT_SIZE event for the sizer to be triggered from the SetSize either. If there's no size event after the sizer has been set, then there is no automatic layout. Your test case is also relying on the frame to resize its only child (the panel) to fill the client area, and that is also done in the frame's EVT_SIZE and will not be handled by a self.Layout() call.
So you can either add the panel to a sizer assigned to the frame, and then a Layout would probably work. Or you can simply call SendSizeEvent to trigger the normal frame/child and sizer layout functionality.
Thanks for the insight Robin. I’ll give that a shot.
-Jake Larrimore
···
On Monday, October 21, 2013 7:46:45 PM UTC-4, Robin Dunn wrote:
Jake Larrimore wrote:
Hello users,
I am having an issue implementing the wx.NO_BORDER style with frames.
I’ve recreated my issue with the attached samples, WithBorder.py is what
the app should look like, and WithoutBorder.py is using the
style=wx.NO_BORDER.
When I run the WithoutBorder.py file, all of the widgets get jammed into
the default position in the upper left corner.
Is this an issue with my sizers, or the NO_BORDER call,
Yes. (Both of them, sorta.)
When there is no border then there is no extra EVT_SIZE event when the
frame is shown, and since you set its size before the sizer is set, then
there is no EVT_SIZE event for the sizer to be triggered from the
SetSize either. If there’s no size event after the sizer has been set,
then there is no automatic layout. Your test case is also relying on
the frame to resize its only child (the panel) to fill the client area,
and that is also done in the frame’s EVT_SIZE and will not be handled by
a self.Layout() call.
So you can either add the panel to a sizer assigned to the frame, and
then a Layout would probably work. Or you can simply call SendSizeEvent
to trigger the normal frame/child and sizer layout functionality.