Files
wxWidgets/wxPython/demo/wxMiniFrame.py
Robin Dunn 64dfb023eb Switched to using True/False in the wxPython lib and demo instead of
true/false or TRUE/FALSE to prepare for the new boolean type and
constants being added to Python.  Added code to wx.py to test for the
existence of the new constants and to create suitable values if not
present.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-02-26 18:38:37 +00:00

48 lines
1.2 KiB
Python

from wxPython.wx import *
#---------------------------------------------------------------------------
class MyMiniFrame(wxMiniFrame):
def __init__(self, parent, title, pos=wxDefaultPosition, size=wxDefaultSize,
style=wxDEFAULT_FRAME_STYLE ):
wxMiniFrame.__init__(self, parent, -1, title, pos, size, style)
panel = wxPanel(self, -1)
button = wxButton(panel, -1, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, button.GetId(), self.OnCloseMe)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
self.Close(True)
def OnCloseWindow(self, event):
print "OnCloseWindow"
self.Destroy()
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = MyMiniFrame(frame, "This is a wxMiniFrame",
#pos=(250,250), size=(200,200),
style=wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ)
win.SetSize((200, 200))
win.CenterOnParent(wxBOTH)
frame.otherWin = win
win.Show(True)
#---------------------------------------------------------------------------
overview = """\
"""