diff --git a/IPython/frontend/wx/console_widget.py b/IPython/frontend/wx/console_widget.py index bc2a0f7..d0fe69b 100644 --- a/IPython/frontend/wx/console_widget.py +++ b/IPython/frontend/wx/console_widget.py @@ -174,10 +174,7 @@ class ConsoleWidget(editwindow.EditWindow): if refresh: current_time = time.time() if current_time - self._last_refresh_time > 0.03: - # Maybe this is faster than wx.Yield(), this is certainly - # more robust under windows, as it avoids recursive - # Yields. - self.ProcessEvent(wx.PaintEvent()) + wx.Yield() self._last_refresh_time = current_time diff --git a/IPython/frontend/wx/wx_frontend.py b/IPython/frontend/wx/wx_frontend.py index 53962ef..86b885d 100644 --- a/IPython/frontend/wx/wx_frontend.py +++ b/IPython/frontend/wx/wx_frontend.py @@ -286,10 +286,12 @@ class WxController(ConsoleWidget, PrefilterFrontEnd): if i in self._markers: self.MarkerDeleteHandle(self._markers[i]) self._markers[i] = self.MarkerAdd(i, _COMPLETE_BUFFER_MARKER) - # Update the display: - wx.Yield() - self.GotoPos(self.GetLength()) - PrefilterFrontEnd.execute(self, python_string, raw_string=raw_string) + # Use a callafter to update the display robustly under windows + def callback(): + self.GotoPos(self.GetLength()) + PrefilterFrontEnd.execute(self, python_string, + raw_string=raw_string) + wx.CallAfter(callback) def save_output_hooks(self): self.__old_raw_input = __builtin__.raw_input