Custom subclass of App Designer Component doesn't show up

4 views (last 30 days)
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 Comment
Nicolas B.
Nicolas B. on 31 Oct 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.

Sign in to comment.

Answers (0)

Categories

Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!