Perhaps consider rephrasing it one more time.
I have a function called
“ButtonPressed”, called when the
button within the source widget is
pressed, the behavior of which I want
to customize for each instance of the
source widget within “Widget1”. Thank
you so much for your answer;
For example, what does it mean to customise the behaviour? This sounds very much like what I originally posted. The base class has a function and the inheriting children override it with their own versions. Each child would be able to handle it differently providing they’re of different class.
Perhaps your have Interfaces on your mind, where unrelated classes can talk to each other via a set of functions declared in the Interface.
- the player interacts with various actors in the scene by pressing E
- press E on the tree, Shake the tree, apples fall
- press E on the medkit, Use the medkit, health goes up
- press E on the bucket, Kick it, we’re dead
Here Shake, Use & Kick are interface functions and the target object decides how to implement any of them. From the player’s perspective they just interact in the same way, but the end result depends on the target actor.