?// [(Panel)] [0] - [Initialize]
// will be later in library
void _handleClicked(const mapping& event) {
DebugTN(__FUNCTION__,event);
}
main() { omf_base_ui_component_init(model);
uiConnect("_handleClick", uxBackground.name, "Clicked");
}
But when i execute this code, i get an error in uiConnect line, depicting, that a function is not defined.
How to connect on such events? (i want to connect on Clicked, MouseRelease and MousePressed later)
Re: Using uiConnect for Clicked event of Rectangle?
Postby mkoller »
You can't. uiConnect() can only connect to user defined events but not to the system defined standard events which only start their respective scripts.
You can only call your function from the lib from inside the objects "clicked" script.
Re: Using uiConnect for Clicked event of Rectangle?
Postby flindecke »
Thanks for clarification.
It would be nice to see this "feature" in the future.
I am currently developing a library to simplify creating symbols with a "convention" behavior, i.e. when a symbol with "uxBackground" is available and developer defines a "capability" the library should automatically do the rest.
It would be nice to get rid of the symbols "clicked" script (and also the mouse pressed and release scripts). Less code, less errors while developing those symbols.