]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MiniFrame.py
fixed wxSetEnv to correctly set variable in Unicode build
[wxWidgets.git] / wxPython / demo / MiniFrame.py
1
2 import wx
3
4 #---------------------------------------------------------------------------
5 class 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
28 def 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
41 overview = """\
42 A MiniFrame is a Frame with a small title bar. It is suitable for floating
43 toolbars that must not take up too much screen area. In other respects, it's the
44 same as a wx.Frame.
45 """
46
47
48 if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])