3 from wxPython
.wx
import *
4 from wxPython
.html
import *
6 #----------------------------------------------------------------------
9 class TestPanel(wxPanel
):
10 def __init__(self
, parent
, id=-1, size
=wxDefaultSize
, bgcolor
=None):
11 wxPanel
.__init
__(self
, parent
, id, size
=size
)
14 self
.SetBackgroundColour(bgcolor
)
16 wxStaticText(self
, -1, 'Name:', wxPoint(10, 10))
17 wxStaticText(self
, -1, 'Email:', wxPoint(10, 40))
19 self
.name
= wxTextCtrl(self
, -1, '', wxPoint(50, 10), wxSize(100, -1))
20 self
.email
= wxTextCtrl(self
, -1, '', wxPoint(50, 40), wxSize(100, -1))
22 wxButton(self
, 12121, 'Okay', wxPoint(50, 70))
23 EVT_BUTTON(self
, 12121, self
.OnButton
)
26 def OnButton(self
, event
):
27 name
= self
.name
.GetValue()
28 email
= self
.email
.GetValue()
29 dlg
= wxMessageDialog(self
,
30 'You entered:\n %s\n %s' % (name
, email
),
31 'Results', style
= wxOK | wxICON_INFORMATION
)
37 #----------------------------------------------------------------------
39 class TestHtmlPanel(wxPanel
):
40 def __init__(self
, parent
, id=-1, size
=wxDefaultSize
):
42 wxPanel
.__init
__(self
, parent
, id, size
=size
)
43 self
.html
= wxHtmlWindow(self
, -1, wxPoint(5,5), wxSize(400, 350))
44 self
.html
.SetPage(About
.MyAboutBox
.text
% wx
.__version
__)
47 #----------------------------------------------------------------------