]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyCrustApp.py
de283bb9719b650dd2196f74f4eaa949a80c98bb
[wxWidgets.git] / wxPython / wxPython / lib / PyCrust / PyCrustApp.py
1 #!/usr/bin/env python
2 """PyCrustApp is a python shell and namespace browser application."""
3
4 __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
5 __cvsid__ = "$Id$"
6 __revision__ = "$Revision$"[11:-2]
7
8 from wxPython.wx import *
9 from crust import CrustFrame
10
11
12 class App(wxApp):
13 """PyCrust standalone application."""
14
15 def OnInit(self):
16 wxInitAllImageHandlers()
17 locals = {'__app__': 'PyCrust Standalone Application'}
18 self.crustFrame = CrustFrame(locals=locals)
19 self.crustFrame.SetSize((750, 525))
20 self.crustFrame.Show(true)
21 self.SetTopWindow(self.crustFrame)
22 # Add the application object to the sys module's namespace.
23 # This allows a shell user to do:
24 # >>> import sys
25 # >>> sys.application.whatever
26 import sys
27 sys.application = self
28 return true
29
30
31 def main():
32 application = App(1)
33 application.MainLoop()
34
35 if __name__ == '__main__':
36 main()
37
38