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>
|