You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working right now on a project, that utilizes the menubar:
Functionality of this widget is pretty clear:
on hover, change background and show tooltip
on click, execute predefined action
on click outside of the widget, close it...
and the third point gave me this headache. It's pretty simple to program this behaviour - just implement the MouseDown event on App class, and if not event.get_content_offset(widget) it will close the menu or do whatever else you want.
I thought that I could share this widget later on, as from my point of view Textual lacks this kind of widget. But - it will be hard to reuse for other people, as it requires additional code on the app subclass.
So, my feature request is the ability to add global event handlers directly from widget.
I've discussed with Will on Discord about Widget.capture_mouse(true), but... this captures the mouse and prohibits other events from hapenning, like hover or click on submenu items (subwidgets in this context) which is not acceptable.
The text was updated successfully, but these errors were encountered:
Hello,
I'm working right now on a project, that utilizes the menubar:
Functionality of this widget is pretty clear:
and the third point gave me this headache. It's pretty simple to program this behaviour - just implement the MouseDown event on App class, and
if not event.get_content_offset(widget)
it will close the menu or do whatever else you want.I thought that I could share this widget later on, as from my point of view Textual lacks this kind of widget. But - it will be hard to reuse for other people, as it requires additional code on the app subclass.
So, my feature request is the ability to add global event handlers directly from widget.
I've discussed with Will on Discord about
Widget.capture_mouse(true)
, but... this captures the mouse and prohibits other events from hapenning, like hover or click on submenu items (subwidgets in this context) which is not acceptable.The text was updated successfully, but these errors were encountered: