Difference between revisions of "Vision4Mac Documentation"

Line 1: Line 1:
 +
== Object creation ==
 +
The way classes will be created is somewhat special in Eiffel Vision. Take a look at EV_ANY (, EV_ANY_I)
 +
 
== Event Handling ==
 
== 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:
 
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:

Revision as of 11:50, 14 August 2006

Object creation

The way classes will be created is somewhat special in Eiffel Vision. Take a look at EV_ANY (, EV_ANY_I)

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)

on_callback

-> The on_callback function is getting really ugly, here is my idea what we could do about that: we could create a on_callback* function in the WIDGET_IMP class and then only do the selection (which event type goes to which widget?) in the on_callback function of APPLICATION_IMP. The specifics could then be done in the widget's function.