The following code is adapted from a problem I've been having with the PythonCard webserver sample and simply forgot to report previously. The issue is that the size passed in at init (800, 327) seems to be ignored on Windows, but works as expected on the Mac. The behavior changed a while ago, but I don't remember which 2.5.2.x release it was. The initSizers code is my standard way of dealing with layouts where there is only one item on a panel and the window is supposed to be growable. I haven't noticed the issue with other controls like TextCtrl so this may simply be a bug where the min size is not set properly at init on Windows with a wxSTC?!
import wx
from wx import stc
print "wx.VERSION", wx.VERSION
class MyApp(wx.App):
def OnInit(self):
self.frame = wx.Frame(None, -1, "sizer problem", size=(800, 482))
self.panel = wx.Panel(self.frame, -1)
# on Windows the window will be small
# but on the Mac the window will be the size specified below
self.text = stc.StyledTextCtrl(self.panel, -1, (0, 0), (800, 327))
self.frame.Show(True)
self.SetTopWindow(self.frame)
self.initSizers()
return True
def initSizers(self):
sizer1 = wx.BoxSizer(wx.VERTICAL)
sizer1.Add(self.text, 1, wx.EXPAND)
sizer1.Fit(self.frame)
sizer1.SetSizeHints(self.frame)
self.panel.SetSizer(sizer1)
self.panel.SetAutoLayout(1)
self.panel.Layout()
app = MyApp(0)
app.MainLoop()
ka