How to pass a superclass method as a calback?
Ältere Kommentare anzeigen
Does anybody know how to pass a superclass function as a calback?
For example a button callback:
btn = uicontrol('Style', 'pushbutton', 'String', 'Example',...
'Position', [20 20 50 20],...
'Callback', @(~, ~)methodFromSuperclass@superclass(obj));
But this one gives an error:
"@" Within a method, a superclass method of the same name is called by saying method@superclass. The left operand of "@" must be the method name.
Thanks, Mario
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Subclass Definition finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!