realbasic-nug
[Top] [All Lists]

Re: Timer by Code?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Timer by Code?
From: "Glenn L. Austin" <glenn at austin-home dot com>
Date: Wed, 30 May 2007 23:25:47 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <d2e2da307c84eba068f56e7a62d79194 at proaxis dot com> <2D884F6B-2C2E-439B-A282-FCE98D64928E at chaoticbox dot com>
On May 30, 2007, at 11:17 PM, Frank Condello wrote:

> On 31-May-07, at 2:01 AM, Jim Wagner wrote:
>
>> Help,. I seem to be stuck!
>>
>> When you add a timer to a class in code by using the new operator,  
>> how
>> to you access the timer's action event?
>
> Create a Timer subclass that implements the event, then create an
> instance of that subclass.

What I did was create the Timer subclass that took a TimerHandler as  
a handler with a method that took the timer as a parameter, in the  
Timer subclass' action it calls the TimerHandler's handler method  
with the instance as a parameter, then defined TimerHandler as a  
class interface, then defined the class with a TimerHandler interface.

I know, a lot of work, but it made it easy to create timers in code  
then handle them in the defining class simply by handling the  
TimerHandler's method.

-- 
Glenn L. Austin <><
Computer Wizard and Race Car Driver
<glenn at austin-home dot com>
<http://www.austin-home.com/glenn/>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>