]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/samples/wx_examples/hello/hello.py
Added wxRTTI for the new wxVScrolledWindow, wxVListBox, and
[wxWidgets.git] / wxPython / samples / wx_examples / hello / hello.py
... / ...
CommitLineData
1#!/usr/bin/env python
2
3"""Hello, wxPython! program."""
4
5__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
6__cvsid__ = "$Id$"
7__revision__ = "$Revision$"[11:-2]
8
9import wx
10
11class Frame(wx.Frame):
12 """Frame class that displays an image."""
13
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)
21
22class App(wx.App):
23 """Application class."""
24
25 def OnInit(self):
26 wx.InitAllImageHandlers()
27 image = wx.Image('wxPython.jpg', wx.BITMAP_TYPE_JPEG)
28 self.frame = Frame(image)
29 self.frame.Show()
30 self.SetTopWindow(self.frame)
31 return True
32
33def main():
34 app = App()
35 app.MainLoop()
36
37if __name__ == '__main__':
38 main()