]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/wxFrame1.py
3 from wxPython
.wx
import *
9 return wxFrame1(parent
)
13 [wxID_WXFRAME1BUTTON1
, wxID_WXFRAME1
] = map(lambda _init_ctrls
: wxNewId(), range(2))
15 class wxFrame1(wxFrame
):
16 def _init_utils(self
):
19 def _init_ctrls(self
, prnt
):
20 wxFrame
.__init
__(self
, size
= wxSize(960, 662), id = wxID_WXFRAME1
, title
= 'wxFrame1', parent
= prnt
, name
= '', style
= wxDEFAULT_FRAME_STYLE
, pos
= (-1, -1))
23 self
.button1
= wxButton(label
= 'button1', id = wxID_WXFRAME1BUTTON1
, parent
= self
, name
= 'button1', size
= wxSize(75, 23), style
= 0, pos
= wxPoint(216, 152))
24 EVT_BUTTON(self
.button1
, wxID_WXFRAME1BUTTON1
, self
.OnButton1Button
)
26 def __init__(self
, parent
):
27 self
._init
_ctrls
(parent
)
30 self
.SetTitle('Frame %d' % frame_count
)
31 print 'Frame %d' % frame_count
33 EVT_IDLE(self
, self
.OnIdle
)
35 def OnButton1Button(self
, event
):
36 print 'Closing %s' % self
.GetTitle()
39 def OnIdle(self
, evt
):
41 #print self.GetTitle(), "shown"
42 #print self.Show(false), self.Show(true)
43 #import win32gui, win32con
44 #win32gui.ShowWindow(self.GetHandle(), win32con.SW_SHOW)
52 ## import win32gui, win32con
53 ## win32gui.ShowWindow(frame1.GetHandle(), win32con.SW_SHOW)
61 print frame2
.Show(true
)
65 application
= BoaApp(0)
66 application
.MainLoop()
68 if __name__
== '__main__':
71 ##if __name__ == '__main__':
72 ## app = wxPySimpleApp()
74 ## frame1 = create(None)
77 ## frame2 = create(None)