widgets-toolbox
widgets-toolbox copied to clipboard
BaseWidget should ensure BackgroundColorListener is set so that Grid will be updated
Add this to constructor to ensure background color listener is still set if the concrete class doesn't modify the BackgroundColorableComponents. This ensures it will still update the color of the Grid on background change.
function obj = BaseWidget(varargin)
% Attach internal postSetup callback
args = horzcat(varargin, {"CreateFcn", @(src,evt)postSetup_I(src)});
% Call superclass constructor
obj = [email protected](args{:});
% Ensure background color listener has been generated
if isempty(obj.BackgroundColorListener)
obj.updateBackgroundColorableComponents()
obj.listenForBackgroundChange();
end
end %function