I wanted to be able to have the text visible only on mouseover. SO I added an optionaltext parameter, and I added two commands, one for mouse in, one for mouse out.
In canvas_position_marker, I added this in the arguments for init:
command2: Callable = None,
command3: Callable = None,
optionaltext = None,
def mouse_enter(self, event=None):
if sys.platform == "darwin":
self.map_widget.canvas.config(cursor="pointinghand")
elif sys.platform.startswith("win"):
self.map_widget.canvas.config(cursor="hand2")
else:
self.map_widget.canvas.config(cursor="hand2") # not tested what it looks like on Linux!
self.commandmousein(self)
def mouse_leave(self, event=None):
self.map_widget.canvas.config(cursor="arrow")
self.commandmouseout(self)
I wanted to be able to have the text visible only on mouseover. SO I added an optionaltext parameter, and I added two commands, one for mouse in, one for mouse out.
In canvas_position_marker, I added this in the arguments for init: command2: Callable = None, command3: Callable = None, optionaltext = None,
Then this to init:
Then this to mouse enter, mouse leave: