New topic: Events and non GUI classes
<http://forums.realsoftware.com/viewtopic.php?t=32446> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message tomsi Post subject: Events and non GUI classesPosted: Wed Feb 10, 2010 6:34 pm Joined: Wed Nov 16, 2005 4:58 pm Posts: 74 Location: Sandvika, Norway In my quest to find a solution to my threading problem, I hit new hurdles/challenges. This time it is handling events. I see that I can define events in my extended Timer Class. And if I place a timer in my mainWindow, Ican change it to my Timer class and my event handlers show up in the list. Great stuff. But if I create a non-gui class and add a property of my Timer class, I don't see a way of adding handlers for those events in that class. Is it possible to do what I want, or is the mechanism only available for windows and friends? Top mjh Post subject: Re: Events and non GUI classesPosted: Wed Feb 10, 2010 6:59 pm Joined: Sun Feb 19, 2006 3:10 pm Posts: 620 Location: Hamburg, Germany tomsi wrote:But if I create a non-gui class and add a property of my Timer class, I don't see a way of adding handlers for those events in that class. In that case you are creating an instance of your Timer subclass which handles events as they are defined for that subclass. There is no way to define event handlers (or methods for that matter) for an instance, only for a class. The Timer control you are dragging onto a window is more like a subclass, much like a window you define in the IDE is more like a class (a sublass of Window) than an instance. _________________ Michael J. HuÃmann http://digicam-experts.de Top gisborne Post subject: Re: Events and non GUI classesPosted: Wed Feb 10, 2010 7:49 pm Joined: Tue Feb 06, 2007 11:34 pm Posts: 97 Location: Austin, TX REAL's documentation concerning events is egregiously misleading. This was the main thing that prompted me to write a book that properly documents OOP in REALbasic, and to put the section of that book concerning Events online so everyone can read what's really going on. _________________ Read my book, Real OOP with REALbasic Guyren G Howe Relevant Logic LLC guyren-at-relevantlogic.com ~ http://relevantlogic.com REALbasic, PHP, Ruby/Rails, Python programming PostgreSQL, MySQL database design and consulting Technical writing and training Top brisance Post subject: Re: Events and non GUI classesPosted: Wed Feb 10, 2010 8:11 pm Joined: Tue Oct 06, 2009 2:38 am Posts: 153 Check out Charles Yeomans's wonderful DelegatingTimer example. http://www.declaresub.com/article/129/d ... er-example _________________ HOWTO: RB Feedback Utility Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ]
-- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
