flexx icon indicating copy to clipboard operation
flexx copied to clipboard

Support remaining mouse events

Open Korijn opened this issue 8 years ago • 3 comments

There are still a few mouse events remaining that are also quite useful to have:

  • onmouseenter
  • onmouseleave
  • onmouseover
  • onmouseout
  • onclick
  • ondblclick
  • oncontextmenu

Korijn avatar Aug 22 '16 11:08 Korijn

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?

almarklein avatar Aug 29 '16 22:08 almarklein

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.

Korijn avatar Aug 30 '16 05:08 Korijn

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 ...

almarklein avatar Nov 02 '18 11:11 almarklein