Class methods for UI callbacks cannot access attributes defines after callback
3 次查看(过去 30 天)
显示 更早的评论
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!