Skip to content

Commit

Permalink
fix issue #20
Browse files Browse the repository at this point in the history
change CallLater to CallAfter

fix crash in wxpython caused by timer fired on GridWindow after it was destroyed
now the timer is stopped immediately after GridWindow is destroyed
  • Loading branch information
2Eagle2 authored and HelioGuilherme66 committed Nov 2, 2018
1 parent dd17bca commit f4b999d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/robotide/editor/editors.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _create_settings(self):
def _restore_settings_open_status(self):
if self._should_settings_be_open():
self._settings.Expand()
wx.CallLater(200, self._collabsible_changed)
wx.CallAfter(self._collabsible_changed)
else:
self._settings.Collapse()

Expand Down
5 changes: 5 additions & 0 deletions src/robotide/editor/tooltips.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ def __init__(self, grid):
self._information_popup = HtmlPopupWindow(grid, (450, 300))
self._grid = grid
self._tooltip_timer = wx.Timer(grid.GetGridWindow())
grid.GetGridWindow().Bind(wx.EVT_WINDOW_DESTROY, self.OnGridDestroy)
grid.GetGridWindow().Bind(wx.EVT_MOTION, self.OnMouseMotion)
grid.GetGridWindow().Bind(wx.EVT_TIMER, self.OnShowToolTip)
grid.Bind(wx.grid.EVT_GRID_EDITOR_HIDDEN, self.OnGridEditorHidden)

def OnGridDestroy(self, event):
self._tooltip_timer.Stop()
event.Skip()

def OnMouseMotion(self, event):
self._hide_tooltip()
self._start_tooltip_timer()
Expand Down

0 comments on commit f4b999d

Please sign in to comment.