mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Just use Fit() instead of a fixed size, and center the frame just for grins.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,8 +13,7 @@ class MyFrame(wx.Frame):
|
||||
and has a simple menu.
|
||||
"""
|
||||
def __init__(self, parent, title):
|
||||
wx.Frame.__init__(self, parent, -1, title,
|
||||
pos=(150, 150), size=(350, 250))
|
||||
wx.Frame.__init__(self, parent, -1, title)
|
||||
|
||||
# Create the menubar
|
||||
menuBar = wx.MenuBar()
|
||||
@@ -41,7 +40,7 @@ class MyFrame(wx.Frame):
|
||||
panel = wx.Panel(self)
|
||||
|
||||
# and a few controls
|
||||
text = wx.StaticText(panel, -1, "Hello World!")
|
||||
text = wx.StaticText(panel, -1, "Hello World! Welcome to wxPython.")
|
||||
text.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD))
|
||||
text.SetSize(text.GetBestSize())
|
||||
btn = wx.Button(panel, -1, "Close")
|
||||
@@ -65,6 +64,8 @@ class MyFrame(wx.Frame):
|
||||
sizer = wx.BoxSizer()
|
||||
sizer.Add(panel, 1, wx.EXPAND)
|
||||
self.SetSizer(sizer)
|
||||
self.Fit()
|
||||
self.CenterOnScreen(wx.BOTH)
|
||||
|
||||
|
||||
def OnTimeToClose(self, evt):
|
||||
|
||||
Reference in New Issue
Block a user