by iso8859-1@[EMAIL PROTECTED]
Sep 19, 2006 at 10:06 PM
Peter Horan wrote:
> iso8859-1@[EMAIL PROTECTED]
wrote:
>
> > for a GUI I want the View/Controller to observe the Model. The
> > View/Controller registers at the Model as observer. I guess there is
an
> > easy way to get this functionality in ISE Eiffel - for example by
> > inheriting from the correct class - but I don't know which one. Can
> > someone point me in the right direction?
>
> If you are using EiffelVision 2, use the action lists associated with
the Widgets.
>
> For example,
> b: EV_BUTTON
>
> -- Initialisation code fragment
> ...
> button.select_actions.extend(agent set_me(button))
> ...
> set_me(b: EV_TOGGLE_BUTTON) is
> --
> do
> end
> --
In EiffelVision 2 I use the automatic generated event handling with the
code supplied by EiffelBuild. But this is my Usercode. I want my class
to be observable. This way the UI is notified whenever a value changes.
Example: (from an rpg - gurps)
Damage depends on ST. Whenever ST changes, Damage needs to be updated.
If both values are displayed on screen, both Views of them (the st-view
and the damage view) have to be updated. ST and Damage are of type
valueholder which is the class I want to be observable.