Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: Newbie ques...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 821 of 913
Post > Topic >>

Re: Newbie question -> Observer pattern

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.




 4 Posts in Topic:
Newbie question -> Observer pattern
iso8859-1@[EMAIL PROTECTE  2006-09-19 14:19:00 
Re: Newbie question -> Observer pattern
Peter Horan <peter@[EM  2006-09-20 03:19:01 
Re: Newbie question -> Observer pattern
iso8859-1@[EMAIL PROTECTE  2006-09-19 22:06:02 
Re: Newbie question -> Observer pattern
Peter Horan <peter@[EM  2006-09-21 01:22:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:54:59 CDT 2008.