Class methods for UI callbacks cannot access attributes defines after callback
6 ビュー (過去 30 日間)
古いコメントを表示
Akshayaa Pandiyan
2023 年 6 月 20 日
回答済み: Akshayaa Pandiyan
2023 年 6 月 20 日
Hi, I have an uifig defined as a class and its callbacks as private methods for browing through a folder list. However, during the callback I found that the all the attributes that comes after the calling back ui is set to empty.
Example code
classdef myUI
properties
ddArray = cell(1,8);
uiFig;
end
methods (Access = private)
function changeSelection(self, src, ~)
idx = %find the index of the src in ddArray
%for example if the idx = 4
% self.ddArray{5:8} is empty
end
end
methods
%%constructor
function self = myUI(varargin)
<initalise self.uifig>
for ii = 1:8
self.ddArray{ii} = uidropdown(self.uifig, ...
'ValueChangedFcn', @self.changeSelection);
end
end
end
end
Is there a work around for this?
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!