Custom subclass of App Designer Component doesn't show up

4 Ansichten (letzte 30 Tage)
FZ
FZ am 31 Okt. 2019
Kommentiert: Nicolas B. am 31 Okt. 2019
Hi,
When constructing a custom UI component whose class inherits an App-Designer-Components class, the constructed component doesn't show up.
I can't figure out why, any ideas?
Or maybe, App-Designer-Components class were initilally thought to be sealed?
Thank you very much! ;)
FZ
test script:
hf = uifigure();
hb = UIButtonSubClass('Parent', hf);
custom class:
classdef UIButtonSubClass < matlab.ui.control.Button
properties
additionalProperty
end
methods
function this = UIButtonSubClass(varargin)
% constructor
this = this@matlab.ui.control.Button(varargin{:});
this.additionalProperty = 'something';
end
end
end
R2019b
  1 Kommentar
Nicolas B.
Nicolas B. am 31 Okt. 2019
Looking to my test, MATLAB does not accept that a uifigure has a non-native MATLAB class as a children. So unfortunately, it's not possible to do what you want.
However, as alternative solution, you can freely use the property UserData of any MATLAB graphical class.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by