Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 16, 2017 11:34 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Question about events
PostPosted: Mon Apr 23, 2012 8:11 am 
Offline

Joined: Mon Mar 12, 2012 7:34 am
Posts: 18
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about events
PostPosted: Mon Apr 23, 2012 8:43 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
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

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about events
PostPosted: Mon Apr 23, 2012 9:04 am 
Offline

Joined: Mon Mar 12, 2012 7:34 am
Posts: 18
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about events
PostPosted: Mon Apr 23, 2012 9:54 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
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.

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group