##// END OF EJS Templates
Make synchronous printing work better.
Gael Varoquaux -
Show More
@@ -23,6 +23,7 b' import wx'
23 23 import wx.stc as stc
24 24
25 25 from wx.py import editwindow
26 import time
26 27 import sys
27 28 LINESEP = '\n'
28 29 if sys.platform == 'win32':
@@ -115,6 +116,9 b' class ConsoleWidget(editwindow.EditWindow):'
115 116 # The color of the carret (call _apply_style() after setting)
116 117 carret_color = 'BLACK'
117 118
119 # Store the last time a refresh was done
120 _last_refresh_time = 0
121
118 122 #--------------------------------------------------------------------------
119 123 # Public API
120 124 #--------------------------------------------------------------------------
@@ -170,7 +174,10 b' class ConsoleWidget(editwindow.EditWindow):'
170 174 if refresh:
171 175 # Maybe this is faster than wx.Yield()
172 176 self.ProcessEvent(wx.PaintEvent())
173 #wx.Yield()
177 current_time = time.time()
178 if current_time - self._last_refresh_time > 0.03:
179 wx.Yield()
180 self._last_refresh_time = current_time
174 181
175 182
176 183 def new_prompt(self, prompt):
General Comments 0
You need to be logged in to leave comments. Login now