2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
5 class MyMiniFrame(wxMiniFrame
):
6 def __init__(self
, parent
, title
, pos
=wxDefaultPosition
, size
=wxDefaultSize
,
7 style
=wxDEFAULT_FRAME_STYLE
):
8 wxMiniFrame
.__init
__(self
, parent
, -1, title
, pos
, size
, style
)
9 panel
= wxPanel(self
, -1)
11 button
= wxButton(panel
, -1, "Close Me")
12 button
.SetPosition(wxPoint(15, 15))
13 EVT_BUTTON(self
, button
.GetId(), self
.OnCloseMe
)
14 EVT_CLOSE(self
, self
.OnCloseWindow
)
16 def OnCloseMe(self
, event
):
19 def OnCloseWindow(self
, event
):
22 #---------------------------------------------------------------------------
24 def runTest(frame
, nb
, log
):
25 win
= MyMiniFrame(frame
, "This is a wxMiniFrame",
26 #pos=(250,250), size=(200,200),
27 style
=wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ
)
28 win
.SetSize((200, 200))
29 win
.CenterOnParent(wxBOTH
)
34 #---------------------------------------------------------------------------