Override Parent Methods in SubClass in Xojo

well … you can USE events a lot LIKE methods :slight_smile:

https://www.great-white-software.com/blog/2020/02/08/using-events-as-a-way-to-pass-information-to-instances/
https://www.great-white-software.com/blog/2019/07/01/how-do-you-raiseevent/
https://www.great-white-software.com/blog/2019/10/23/about-events/

Basically you could write a subclass that has a handful of methods that are common to every instance
And anything unique to an instance then can be in an event that one of the common method etc raises
Thats a decent way to think about how to use events

But as you mentioned earlier, you can’t call events “up” the chain…
Still seems strange that you can’t override events…

This all feels so different than .NET classes and objects.

Think the other way around
The subclass has the code that is absolutely common to EVERY instance

Where / when you need each instance to do something special you raise an event and then the instance has a chance to do whatever it is thats special to it

This is exactly what you do with a button
Every button draws itself in the same way etc but you add the event handler so each button can do something different when its pressed
If you put that in the subclass EVERY button would behave the same

Ok, thanks, Norm!

Its a little different way to think about things but really handy in lots of ways
Very much “delegating” the decisions and actual code out to instances