##// END OF EJS Templates
wx namespace patch by fernando
vivainio -
r499:e3931745
parent child
Show More
@@ -4,7 +4,7
4 All the matplotlib support code was co-developed with John Hunter,
4 All the matplotlib support code was co-developed with John Hunter,
5 matplotlib's author.
5 matplotlib's author.
6
6
7 $Id: Shell.py 1384 2006-06-29 20:04:37Z vivainio $"""
7 $Id: Shell.py 1988 2006-12-13 16:49:41Z vivainio $"""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -706,7 +706,7 class IPShellWX(threading.Thread):
706 error('Requested wxPython version %s could not be loaded' %
706 error('Requested wxPython version %s could not be loaded' %
707 wantedwxversion)
707 wantedwxversion)
708
708
709 import wxPython.wx as wx
709 import wx
710
710
711 threading.Thread.__init__(self)
711 threading.Thread.__init__(self)
712 self.wx = wx
712 self.wx = wx
@@ -738,20 +738,20 class IPShellWX(threading.Thread):
738
738
739 self.start()
739 self.start()
740
740
741 class TimerAgent(self.wx.wxMiniFrame):
741 class TimerAgent(self.wx.MiniFrame):
742 wx = self.wx
742 wx = self.wx
743 IP = self.IP
743 IP = self.IP
744 tk = self.tk
744 tk = self.tk
745 def __init__(self, parent, interval):
745 def __init__(self, parent, interval):
746 style = self.wx.wxDEFAULT_FRAME_STYLE | self.wx.wxTINY_CAPTION_HORIZ
746 style = self.wx.DEFAULT_FRAME_STYLE | self.wx.TINY_CAPTION_HORIZ
747 self.wx.wxMiniFrame.__init__(self, parent, -1, ' ', pos=(200, 200),
747 self.wx.MiniFrame.__init__(self, parent, -1, ' ', pos=(200, 200),
748 size=(100, 100),style=style)
748 size=(100, 100),style=style)
749 self.Show(False)
749 self.Show(False)
750 self.interval = interval
750 self.interval = interval
751 self.timerId = self.wx.wxNewId()
751 self.timerId = self.wx.NewId()
752
752
753 def StartWork(self):
753 def StartWork(self):
754 self.timer = self.wx.wxTimer(self, self.timerId)
754 self.timer = self.wx.Timer(self, self.timerId)
755 self.wx.EVT_TIMER(self, self.timerId, self.OnTimer)
755 self.wx.EVT_TIMER(self, self.timerId, self.OnTimer)
756 self.timer.Start(self.interval)
756 self.timer.Start(self.interval)
757
757
@@ -759,15 +759,15 class IPShellWX(threading.Thread):
759 update_tk(self.tk)
759 update_tk(self.tk)
760 self.IP.runcode()
760 self.IP.runcode()
761
761
762 class App(self.wx.wxApp):
762 class App(self.wx.App):
763 wx = self.wx
763 wx = self.wx
764 TIMEOUT = self.TIMEOUT
764 TIMEOUT = self.TIMEOUT
765 def OnInit(self):
765 def OnInit(self):
766 'Create the main window and insert the custom frame'
766 'Create the main window and insert the custom frame'
767 self.agent = TimerAgent(None, self.TIMEOUT)
767 self.agent = TimerAgent(None, self.TIMEOUT)
768 self.agent.Show(self.wx.false)
768 self.agent.Show(False)
769 self.agent.StartWork()
769 self.agent.StartWork()
770 return self.wx.true
770 return True
771
771
772 self.app = App(redirect=False)
772 self.app = App(redirect=False)
773 self.wx_mainloop(self.app)
773 self.wx_mainloop(self.app)
General Comments 0
You need to be logged in to leave comments. Login now