4 #---------------------------------------------------------------------- 
   6 class TestPanel(wx
.Panel
): 
   7     def __init__(self
, parent
, log
): 
   8         wx
.Panel
.__init
__(self
, parent
, -1, 
   9                          style
=wx
.NO_FULL_REPAINT_ON_RESIZE
) 
  12         b 
= wx
.Button(self
, 10, "Default Button", (20, 20)) 
  13         self
.Bind(wx
.EVT_BUTTON
, self
.OnClick
, b
) 
  15         b
.SetSize(b
.GetBestSize()) 
  17         b 
= wx
.Button(self
, 20, "HELLO AGAIN!", (20, 80)) ##, (120, 45)) 
  18         self
.Bind(wx
.EVT_BUTTON
, self
.OnClick
, b
) 
  19         b
.SetToolTipString("This is a Hello button...") 
  21         b 
= wx
.Button(self
, 40, "Flat Button?", (20,150), style
=wx
.NO_BORDER
) 
  22         b
.SetToolTipString("This button has a style flag of wx.NO_BORDER. On some platforms that will give it a flattened look.") 
  23         self
.Bind(wx
.EVT_BUTTON
, self
.OnClick
, b
) 
  26     def OnClick(self
, event
): 
  27         self
.log
.write("Click! (%d)\n" % event
.GetId()) 
  29 #---------------------------------------------------------------------- 
  31 def runTest(frame
, nb
, log
): 
  32     win 
= TestPanel(nb
, log
) 
  35 #---------------------------------------------------------------------- 
  38 overview 
= """<html><body> 
  41 A button is a control that contains a text string or a bitmap and can be 
  42 placed on nearly any kind of window. 
  49 if __name__ 
== '__main__': 
  52     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])