]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/MiniFrame.py
Don't allow parameterless wxDropSource
[wxWidgets.git] / wxPython / demo / MiniFrame.py
... / ...
CommitLineData
1
2import wx
3
4#---------------------------------------------------------------------------
5class MyMiniFrame(wx.MiniFrame):
6 def __init__(
7 self, parent, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
8 style=wx.DEFAULT_FRAME_STYLE
9 ):
10
11 wx.MiniFrame.__init__(self, parent, -1, title, pos, size, style)
12 panel = wx.Panel(self, -1)
13
14 button = wx.Button(panel, -1, "Close Me")
15 button.SetPosition((15, 15))
16 self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
17 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
18
19 def OnCloseMe(self, event):
20 self.Close(True)
21
22 def OnCloseWindow(self, event):
23 print "OnCloseWindow"
24 self.Destroy()
25
26#---------------------------------------------------------------------------
27
28def runTest(frame, nb, log):
29 win = MyMiniFrame(frame, "This is a wx.MiniFrame",
30 #pos=(250,250), size=(200,200),
31 style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ)
32 win.SetSize((200, 200))
33 win.CenterOnParent(wx.BOTH)
34 frame.otherWin = win
35 win.Show(True)
36
37
38#---------------------------------------------------------------------------
39
40
41overview = """\
42A MiniFrame is a Frame with a small title bar. It is suitable for floating
43toolbars that must not take up too much screen area. In other respects, it's the
44same as a wx.Frame.
45"""
46
47
48if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])])