]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MiniFrame.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
8 #---------------------------------------------------------------------------
9 class MyMiniFrame(wx
.MiniFrame
):
11 self
, parent
, title
, pos
=wx
.DefaultPosition
, size
=wx
.DefaultSize
,
12 style
=wx
.DEFAULT_FRAME_STYLE
15 wx
.MiniFrame
.__init
__(self
, parent
, -1, title
, pos
, size
, style
)
16 panel
= wx
.Panel(self
, -1)
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
)
23 def OnCloseMe(self
, event
):
26 def OnCloseWindow(self
, event
):
30 #---------------------------------------------------------------------------
32 def runTest(frame
, nb
, log
):
33 win
= MyMiniFrame(frame
, "This is a wxMiniFrame",
34 #pos=(250,250), size=(200,200),
35 style
=wx
.DEFAULT_FRAME_STYLE | wx
.TINY_CAPTION_HORIZ
)
36 win
.SetSize((200, 200))
37 win
.CenterOnParent(wx
.BOTH
)
42 #---------------------------------------------------------------------------
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
52 if __name__
== '__main__':
55 run
.main(['', os
.path
.basename(sys
.argv
[0])])