flexx
flexx copied to clipboard
Support remaining mouse events
There are still a few mouse events remaining that are also quite useful to have:
-
onmouseenter
-
onmouseleave
-
onmouseover
-
onmouseout
-
onclick
-
ondblclick
-
oncontextmenu
I am not entirely sure if it makes sense to give all widgets all of these events. E.g. as it is now, the Button
has mouse click, but Widget
has not. Though most other events seem to be applicable to any custom widget, so then why not click. What do you think?
I can think of some use cases:
- For desktop-style applications specifically, it's quite common to override the context menu with a custom one, and since it needs to be "contextual", that event should be available on all widgets, at least.
- The mouseover/out enter/leave events can be useful for visual cues, e.g. drag and drop of an element, highlighting it when you mouse-over.
I understand how you provide ready-to-go properties on specific widgets, which are intended to be used in a specific way, like Button
, but when you're thinking about custom flexx widgets, you want to maximize your options, I think.
I've found during a certain performance investigation that the binding of these events is a relatively costly part of the widget instantiation. Nothing too bad, but it adds up for large apps with many (tiny) widgets. E.g. each item in a TreeWidget is a widget too.
I think that in a way, the original issue and my comment above seem to call for a more configurable approach to binding mouse events ...