]>
Commit | Line | Data |
---|---|---|
8fa876ca RD |
1 | # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) |
2 | # | |
3 | # o Updated for wx namespace | |
4 | # | |
cf694132 | 5 | |
8fa876ca | 6 | import wx |
cf694132 RD |
7 | |
8 | #--------------------------------------------------------------------------- | |
8fa876ca RD |
9 | class MyMiniFrame(wx.MiniFrame): |
10 | def __init__( | |
11 | self, parent, title, pos=wx.DefaultPosition, size=wx.DefaultSize, | |
12 | style=wx.DEFAULT_FRAME_STYLE | |
13 | ): | |
cf694132 | 14 | |
8fa876ca RD |
15 | wx.MiniFrame.__init__(self, parent, -1, title, pos, size, style) |
16 | panel = wx.Panel(self, -1) | |
17 | ||
18 | button = wx.Button(panel, -1, "Close Me") | |
19 | button.SetPosition((15, 15)) | |
20 | self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button) | |
21 | self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) | |
cf694132 RD |
22 | |
23 | def OnCloseMe(self, event): | |
1e4a197e | 24 | self.Close(True) |
cf694132 RD |
25 | |
26 | def OnCloseWindow(self, event): | |
1e4a197e | 27 | print "OnCloseWindow" |
cf694132 RD |
28 | self.Destroy() |
29 | ||
30 | #--------------------------------------------------------------------------- | |
31 | ||
32 | def runTest(frame, nb, log): | |
6bff4be5 | 33 | win = MyMiniFrame(frame, "This is a wxMiniFrame", |
a9fd2e6f | 34 | #pos=(250,250), size=(200,200), |
8fa876ca | 35 | style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ) |
6bff4be5 | 36 | win.SetSize((200, 200)) |
8fa876ca | 37 | win.CenterOnParent(wx.BOTH) |
cf694132 | 38 | frame.otherWin = win |
1e4a197e | 39 | win.Show(True) |
cf694132 RD |
40 | |
41 | ||
42 | #--------------------------------------------------------------------------- | |
43 | ||
44 | ||
cf694132 | 45 | overview = """\ |
8fa876ca RD |
46 | A miniframe is a frame with a small title bar. It is suitable for floating |
47 | toolbars that must not take up too much screen area. In other respects, it's the | |
48 | same as a wxFrame. | |
cf694132 | 49 | """ |
1fded56b RD |
50 | |
51 | ||
1fded56b RD |
52 | if __name__ == '__main__': |
53 | import sys,os | |
54 | import run | |
55 | run.main(['', os.path.basename(sys.argv[0])]) |