Vision4Mac Documentation
Event Handling
Due to some limitations of the wrapper generater we are using event handling is not quite trivial, but here's what you have to do if you want to add a new event:
In the creation procedure you need to have something like this:
id := app_implementation.get_id (current) target := get_event_control_target_external(control) app_implementation.install_event_handler (id, target, {carbonevents_anon_enums}.kEventClassControl, {carbonevents_anon_enums}.kEventMouseDown)
This code first gets an application-wide unique ID. The system needs this to find out which object triggered the event.
??What exactly does the target specify??
And the last line says that we would like to catch all events with the given id that are of a specific type. (here: MouseDown Events on a Control)
-> The on_callback function is getting really ugly, here is my idea what we could do about that: