Frames and Dialogs → MiniFrame
时间:2007-04-12 来源:wxPhoenix
Overview = """\
A MiniFrame is a Frame with a small title bar. It is suitable for floating
toolbars that must not take up too much screen area. In other respects, it's the
same as a wx.Frame.
"""
import wx class Frame(wx.MiniFrame):
def __init__(
self, parent, id=-1, title='Test MiniFrame', pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE
):
wx.MiniFrame.__init__(self, parent, id, title, pos, size, style)
panel = wx.Panel(self, -1)
button = wx.Button(panel, -1, "Close Me")
button.SetPosition((15, 15))
self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
def OnCloseMe(self, event):
self.Close(True)
def TestFrame():
app = wx.PySimpleApp()
frame = Frame(parent=None, id=-1, title="Test Frame")
frame.Centre()
frame.Show()
app.MainLoop()
if __name__ =="__main__":
TestFrame()
A MiniFrame is a Frame with a small title bar. It is suitable for floating
toolbars that must not take up too much screen area. In other respects, it's the
same as a wx.Frame.
"""
import wx class Frame(wx.MiniFrame):
def __init__(
self, parent, id=-1, title='Test MiniFrame', pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE
):
wx.MiniFrame.__init__(self, parent, id, title, pos, size, style)
panel = wx.Panel(self, -1)
button = wx.Button(panel, -1, "Close Me")
button.SetPosition((15, 15))
self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
def OnCloseMe(self, event):
self.Close(True)
def TestFrame():
app = wx.PySimpleApp()
frame = Frame(parent=None, id=-1, title="Test Frame")
frame.Centre()
frame.Show()
app.MainLoop()
if __name__ =="__main__":
TestFrame()
相关阅读 更多 +