]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-01/hello.py
3 """Hello, wxPython! program."""
8 """Frame class that displays an image."""
10 def __init__(self
, image
, parent
=None, id=-1,
11 pos
=wx
.DefaultPosition
, title
='Hello, wxPython!'):
12 """Create a Frame instance and display image."""
13 temp
= image
.ConvertToBitmap()
14 size
= temp
.GetWidth(), temp
.GetHeight()
15 wx
.Frame
.__init
__(self
, parent
, id, title
, pos
, size
)
16 panel
= wx
.Panel(self
)
17 self
.bmp
= wx
.StaticBitmap(parent
=panel
, bitmap
=temp
)
18 self
.SetClientSize(size
)
21 """Application class."""
24 image
= wx
.Image('wxPython.jpg', wx
.BITMAP_TYPE_JPEG
)
25 self
.frame
= Frame(image
)
27 self
.SetTopWindow(self
.frame
)
34 if __name__
== '__main__':