Running the code I get a window of an actual size of 295 width by 307 height (taking into consideration the Windows´s top window bar) I am using Python 2.7 in Windows 10. What am I missing? Thanks
|
I am new to wxPython and I am finding some issues while seting a given size for both frames and windows (widgets). I have isolated the issue to the simplest case where I try to create a Frame of 250x250 pixels.
I would expect the window (wx.Frame) having 300 pixels width.
#!/bin/env python
import wx
class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, title="The Main Frame")
self.SetTopWindow(self.frame)
self.frame.Show(True)
return True
class MyFrame(wx.Frame):
def __init__(self, parent, id=wx.ID_ANY, title="", pos=wx.DefaultPosition, size=(300,100), style=wx.DEFAULT_FRAME_STYLE, name="MyFrame"):
super(MyFrame, self).__init__(parent, id, title, pos, size, style, name)
self.panel = wx.Panel(self)
if __name__ == "__main__":
app = MyApp(False)
app.MainLoop()