I'm a novice wxPython user as well as a near-novice Python user, and I'm having trouble with basic frame sizing. In the example below, I want to create a screen-centered frame that takes up 90% of the horizontal and vertical screen space. But my TestFrame size parameter is not taking.
···
__________________________________________________
import wx
class TestFrame(wx.Frame):
def __init__(self, parent, id, title, size):
wx.Frame.__init__(self, parent, id, title, size)
class App(wx.App):
def OnInit(self):
x = wx.SystemSettings_GetMetric(wx.SYS_SCREEN_X)
y = wx.SystemSettings_GetMetric(wx.SYS_SCREEN_Y)
frame = TestFrame(None,-1,"Test Frame", size=(.9*x,.9*y))
frame.Center(wx.BOTH)
frame.Show(True)
self.SetTopWindow(frame)
return True
if __name__ == '__main__':
app = App(0)
app.MainLoop()
__________________________________________________
(1) What am I missing here?
(2) Is there a better way to accomplish my 90%-of-screen sizing goal?
(3) Is there anything else about my code above that is not up to wxPython coding "best practice" standards?
Bob
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.0.408 / Virus Database: 268.13.9/490 - Release Date: 10/20/2006