Overriding a function in an instance [on hold]
- by MustSeeMelons
Is it possible to override a function by instance? For example, A and B are both instances of MyClass. I have a function Action(), and I want to specify its implementation for each instance.
To be more specific - the class is a Button, and the function is Clicked(). I don't want to derive a class 5 times to create 5 different button actions. Was thinking of something like it's handled in Java Swing: create a button, add code for the button press and use the button.