I want to see tooltip as in Qt when the mouse pointer is hovering over icon in ActionBar.
Yes, I can use mode='spinner'
, but icons are nicer.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
A simple example you can improve and extend:
First I bind
on_mouse_pos
method toWindow.mouse_pos
event so I can detect when the mouse cursor hovers over my subclass ofActionButton
. This is based on this snippet. Then I shedule an action withClock.schedule_once()
to make my toolbox visible if I won't move my cursor. To display I'm just adding a subclass of Label to the stack of widgets. You can replacedisplay_tooltip()
andclose_tooltip()
methods with more sophisticated ones.EDIT: Updated the code accordingly to this answer