138 reputation
4
bio website
location
age
visits member for 3 years
seen May 8 at 16:46

Jul
16
comment how to use the same behaviour in different classes
Thanks, that was what I found in my own answer. Since you posted the code and all I will give you the valid answer to you. Cheers.
Jul
16
comment how to use the same behaviour in different classes
The question is just simply: how to use the same behaviour/implementation in different classes without using an interface. If that is still not clear enough I can write some code to show the problem.
Jul
16
comment how to use the same behaviour in different classes
The label icon thing was just an example. What if I want to align 2 (or more) visual elements? 2 icons, 2 labels, 1 icon and 1 label, etc.
Jul
16
comment how to use the same behaviour in different classes
What I meant was, that all icons dervie from the same Image class, and all labels derive from the same Label class. Just in case it was not clear.
Jul
16
comment how to use the same behaviour in different classes
Yes, the label and the icon are the same classes. But I want the behaviour in the classes that use composition with the icon and the label. For example the button class.