TomSchimansky / TomSchimansky/TkinterMapView
A little addition I made (text on mouseover)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 743
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
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:
self.commandmousein = command2
self.commandmouseout = command3
self.optionaltext = optionaltext
Then this to mouse enter, mouse leave:
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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the canvas_position_marker class and reviewing its init, mouse_enter, and mouse_leave methods. Check how marker text and mouse callbacks are currently handled, then verify the optional text and mouse-in/mouse-out behavior in the existing map widget examples or tests. Done means the behavior is optional and existing marker usage remains compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100