Is it possible to add a Timer to a custom class, and have that timer started when the class is initiated?
I know how to use a Timer, but fail to see if and how I can add one to a custom class I’m writing for a DeskTop project.
You could make your class a subclass of Timer or you can add a timer property to your class, create an instance of the timer and use AddHandler / RemoveHandler to link the timer to a method in your class.
If the main purpose of the class isn’t to be a type of Timer, I’d recommend against this approach. A Timer property can be added for support of the class pretty easily as per @kevin_g 's suggestion.
Thanks for the reply, I managed to get it to work, but was a little confused by the Xojo Documentation stating to use a myTimer.run, which does not work; it needs to be myTimer.Action.
The mix of API1 and API2 documentation you find when you google is still a bit annoying.