-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
- Line
ttkwidgets/ttkwidgets/frames/tooltip.py
Line 123 in ebaa7d4
self._canvas.update() - Version
ttkwidgets Version: 0.13.0 - Issue
self._canvas.update() can cause any pending events to be called including _on_leave() event. This will result in self._top_level being reset to None and then the .geometry) call to fail - partial call stack
File "ttkwidgets/frames/tooltip.py", line 177, in config
File "ttkwidgets/frames/tooltip.py", line 125, in show
AttributeError: 'NoneType' object has no attribute 'geometry'
- proposed fix
x, y = self.master.winfo_pointerxy()
self._canvas.update()
# .update() allows background tasks to run could cause on_leave to reset _toplevel to None
if self._toplevel:
# Update the Geometry of the Toplevel to update its position and size
self._toplevel.geometry("{0}x{1}+{2}+{3}".format(
self._canvas.winfo_width(), self._canvas.winfo_height(),
x + self.__offset[0], y + self.__offset[1]))
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels