Custom subclass of App Designer Component doesn't show up

5 ビュー (過去 30 日間)
FZ
FZ 2019 年 10 月 31 日
コメント済み: Nicolas B. 2019 年 10 月 31 日
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 件のコメント
Nicolas B.
Nicolas B. 2019 年 10 月 31 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by