And again I have encounter with some strange problems. Now it's looks like cross-platform issue...
The attached test.py app have *very* strange and unsuspected behavior. On my Ubuntu box everything works fine, but on Windows 2000 SP4 there following issues:
1. Frame resizing. self.SetSizeHints() doesn't set the frame size until frame was resized by draging it's border (see the screenshot No 1).
2. There is maximize button on frame title, but it shouldn't be here, after all it's not appear on Linux. Should I have manually disable it and how?
3. Following code shows big ugly instead of static line (see shot No 2):
# separate line
line = wx.StaticLine(self)
gridSizer.Add(line, (1,0), (1,3), flag=wx.GROW)
As I said previously it's works just fine on Linux, but don't works on Windows.
Linux: Ubuntu Dapper, python 2.4.2, wxpython 2.8.0.1
Windows: Windows 2000 SP4, python 2.4.3, wxpython 2.8.0.1
And again I have encounter with some strange problems. Now it's looks like cross-platform issue...
The attached test.py app have *very* strange and unsuspected behavior. On my Ubuntu box everything works fine, but on Windows 2000 SP4 there following issues:
1. Frame resizing. self.SetSizeHints() doesn't set the frame size until frame was resized by draging it's border (see the screenshot No 1).
SetSizeHints doesn't do SetSize. It just limits what the user can do to the frame.
2. There is maximize button on frame title, but it shouldn't be here, after all it's not appear on Linux. Should I have manually disable it and how?
To remove the maximize button you need to change the frame's style. Try using wx.DEFAULT_FRAME_STYLE & ~wx.MAXIMIZE_BOX
3. Following code shows big ugly instead of static line (see shot No 2):
# separate line
line = wx.StaticLine(self)
gridSizer.Add(line, (1,0), (1,3), flag=wx.GROW)
The static line control on windows will draw itself with whatever height you tell it to, not limit itself to a single line like on Linux. Using the wx.GROW flag with the sizer is spreading the line in both horizontal and vertical directions. The workaround for this is to but the line in a box sizer, and put the box sizer in that spot in the grid sizer. Then you can tell the box sizer to expand the line in just the horizontal direction.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
3. Following code shows big ugly instead of static line (see shot No 2):
# separate line
line = wx.StaticLine(self)
gridSizer.Add(line, (1,0), (1,3), flag=wx.GROW)
The static line control on windows will draw itself with whatever height you tell it to, not limit itself to a single line like on Linux. Using the wx.GROW flag with the sizer is spreading the line in both horizontal and vertical directions. The workaround for this is to but the line in a box sizer, and put the box sizer in that spot in the grid sizer. Then you can tell the box sizer to expand the line in just the horizontal direction.
I made a few modifications to how you were using the sizers and now it
works properly on both *nix and Windows
Removing a SetSizerAndFit call from InitPanel and adding SetSize after SetSizeHints has solve everything! Here a working version that's behavior are same on different OSes.