]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-07/bitmap_button.py
   3 class BitmapButtonFrame(wx
.Frame
): 
   5         wx
.Frame
.__init
__(self
, None, -1, 'Bitmap Button Example',  
   7         panel 
= wx
.Panel(self
, -1) 
   8         bmp 
= wx
.Image("bitmap.bmp", wx
.BITMAP_TYPE_BMP
).ConvertToBitmap() 
   9         self
.button 
= wx
.BitmapButton(panel
, -1, bmp
, pos
=(10, 20)) 
  10         self
.Bind(wx
.EVT_BUTTON
, self
.OnClick
, self
.button
) 
  11         self
.button
.SetDefault() 
  12         self
.button2 
= wx
.BitmapButton(panel
, -1, bmp
, pos
=(100, 20),  
  14         self
.Bind(wx
.EVT_BUTTON
, self
.OnClick
, self
.button2
) 
  16     def OnClick(self
, event
): 
  19 if __name__ 
== '__main__': 
  20     app 
= wx
.PySimpleApp() 
  21     frame 
= BitmapButtonFrame()