source: SHX/trunk/src/sandbox/embedshell.py @ 227

Revision 227, 761 bytes checked in by marcus, 13 years ago (diff)

Example for embedding a python shell.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Author Revision Date
Line 
1import wx
2import wx.py as wxpy
3
4class Frame1(wx.Frame):
5    def _init_ctrls(self, parent):
6        wx.Frame.__init__(self, id=wx.NewId(), name='', parent=parent,
7              style=wx.DEFAULT_FRAME_STYLE, title='Embedding shell')
8
9        self.SetClientSize(wx.Size(900, 200))
10
11        self.panel1 = wx.Panel(id=wx.NewId(), name='panel', parent=self,
12              style=wx.TAB_TRAVERSAL)
13
14    def __init__(self, parent):
15        self._init_ctrls(parent)
16
17        #this uses py.shell, which is used in PyCrust
18        shell = wxpy.shell.Shell(self.panel1, -1, pos=wx.Point(5, 5),
19          size=wx.Size(890,190))
20
21        self.panel1.Layout()
22
23if __name__ == '__main__':
24    app = wx.PySimpleApp()
25    frame = Frame1(None)
26    frame.Show()
27
28    app.MainLoop()
Note: See TracBrowser for help on using the repository browser.