]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyShellApp.py
ff60f5f8456b5545dfc5d916eb5ab13ba59b167c
[wxWidgets.git] / wxPython / wxPython / lib / PyCrust / PyShellApp.py
1 #!/usr/bin/env python
2 """PyShellApp is a python shell 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 shell import ShellFrame
10
11
12 class App(wxApp):
13 """PyShell standalone application."""
14
15 def OnInit(self):
16 wxInitAllImageHandlers()
17 locals = {'__app__': 'PyShell Standalone Application'}
18 self.shellFrame = ShellFrame(locals=locals)
19 self.shellFrame.SetSize((750, 525))
20 self.shellFrame.Show(true)
21 self.shellFrame.shell.SetFocus()
22 self.SetTopWindow(self.shellFrame)
23 # Add the application object to the sys module's namespace.
24 # This allows a shell user to do:
25 # >>> import sys
26 # >>> sys.application.whatever
27 import sys
28 sys.application = self
29 return true
30
31
32 def main():
33 application = App(1)
34 application.MainLoop()
35
36 if __name__ == '__main__':
37 main()
38
39
40