]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wx_examples/hello/hello.py
   3 """Hello, wxPython! program.""" 
   5 __author__ 
= "Patrick K. O'Brien <pobrien@orbtech.com>" 
   7 __revision__ 
= "$Revision$"[11:-2] 
  11 class Frame(wx
.Frame
): 
  12     """Frame class that displays an image.""" 
  14     def __init__(self
, image
, parent
=None, id=-1, 
  15                  pos
=wx
.DefaultPosition
, title
='Hello, wxPython!'): 
  16         """Create a Frame instance and display image.""" 
  17         temp 
= image
.ConvertToBitmap() 
  18         size 
= temp
.GetWidth(), temp
.GetHeight() 
  19         wx
.Frame
.__init
__(self
, parent
, id, title
, pos
, size
) 
  20         self
.bmp 
= wx
.StaticBitmap(parent
=self
, id=-1, bitmap
=temp
) 
  23     """Application class.""" 
  26         wx
.InitAllImageHandlers() 
  27         image 
= wx
.Image('wxPython.jpg', wx
.BITMAP_TYPE_JPEG
) 
  28         self
.frame 
= Frame(image
) 
  30         self
.SetTopWindow(self
.frame
) 
  37 if __name__ 
== '__main__':