I'm using a FlexGridSizer to position a number of controls inside a Frame.
Everything works as expected when I use "standard" controls, such as Buttons
and StaticTexts. When I switch to a GLCanvas, however, it eats all the
horizontal space as soon as I resize the frame (please have a look at the
attached 'canvas.py').
Is this a bug or am I missing something?
I'm using a Linux system with Python 2.4beta1 and wxPython 2.5.2.8u (compiled
from sources).
I'm using a FlexGridSizer to position a number of controls inside a Frame.
Everything works as expected when I use "standard" controls, such as Buttons and StaticTexts. When I switch to a GLCanvas, however, it eats all the horizontal space as soon as I resize the frame (please have a look at the attached 'canvas.py').
Is this a bug or am I missing something?
The GLCanvas doesn't have its own DoGetBestSize method and so it falls back to the default. Since it doesn't have any child widgets or a minimum size defined it will use the current size, which can have a cascading failure if used in a sizer like you did.
To workaround this you can either give the window a minimum size, ( for example: self.v1.SetMinSize((200,200))) or you can ensure that the current size is what you want and then use the wx.FIXED_MINSIZE flag when adding it to the sizer.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!