]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MiniFrame.py
   4 #--------------------------------------------------------------------------- 
   5 class MyMiniFrame(wx
.MiniFrame
): 
   7         self
, parent
, title
, pos
=wx
.DefaultPosition
, size
=wx
.DefaultSize
, 
   8         style
=wx
.DEFAULT_FRAME_STYLE 
 
  11         wx
.MiniFrame
.__init
__(self
, parent
, -1, title
, pos
, size
, style
) 
  12         panel 
= wx
.Panel(self
, -1) 
  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
) 
  19     def OnCloseMe(self
, event
): 
  22     def OnCloseWindow(self
, event
): 
  26 #--------------------------------------------------------------------------- 
  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
) 
  38 #--------------------------------------------------------------------------- 
  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  
  48 if __name__ 
== '__main__': 
  51     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])