So, I have been oscillating back and forth over what kind of callback API to support for the right-click menu API.


The problem is as follows:

The user wants to specify what should happen when a menu item is clicked on.
Do they pass in a function (closure) that gets called? Does the menu item object
get a "onselect" event sent to it? Does the user pass in a LzDelegate to get called back?

I could not decide which mechanism to support, and after going back and forth a few times , I decided to
support all three. So in my current API implementation, when setting the callback, the menu and menuitem classes accept either a function, or an LzDelegate for the callback, and they also send a "onselect" event to themselves.

This seems like the right thing to do and also the wrong thing to do, I'm not sure which.


_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to