Real Software Forums
http://forums.realsoftware.com/

Question about events
http://forums.realsoftware.com/viewtopic.php?f=13&t=43720
Page 1 of 1

Author:  yura-vel [ Mon Apr 23, 2012 8:11 am ]
Post subject:  Question about events

Hello!

I'm new in RB, so do not judge strictly for a simple question) But I can't find documentation or examples, that describes how works events, and how to create custom events.

For Example:
I have two classes A & B. Object of class B should watch about some condition of class A. When condition of A will changed it should generate event, this event should be binded with some event handler in Class B.
How to implement this?

Thanks!

Author:  Bob Keeney [ Mon Apr 23, 2012 8:43 am ]
Post subject:  Re: Question about events

I think in your case you wouldn't use events. I think Class A should maintain a reference to Class B and when the condition occurs it uses the Class B reference to call some Method in Class B.

To get a better feel for Events and Object Oriented Programming I'd recommend the book "REAL OOP with REALbasic" which can be found at http://relevantlogic.com/oop-book/about-the-oop-book.php

Author:  yura-vel [ Mon Apr 23, 2012 9:04 am ]
Post subject:  Re: Question about events

Bob Keeney wrote:
I think in your case you wouldn't use events. I think Class A should maintain a reference to Class B and when the condition occurs it uses the Class B reference to call some Method in Class B.


Thanks, for suggestion. I have already implemented interaction in this way.

Bob Keeney wrote:
To get a better feel for Events and Object Oriented Programming I'd recommend the book "REAL OOP with REALbasic" which can be found at http://relevantlogic.com/oop-book/about-the-oop-book.php


Thanks, for link!

Author:  Bob Keeney [ Mon Apr 23, 2012 9:54 am ]
Post subject:  Re: Question about events

No problem. Events are one of the more obscure topics (IMO) in Real Studio. They are easy to understand in controls but not so much when dealing with non-gui controls.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/