widgets-toolbox icon indicating copy to clipboard operation
widgets-toolbox copied to clipboard

BaseWidget should ensure BackgroundColorListener is set so that Grid will be updated

Open rjackey opened this issue 1 year ago • 0 comments

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

rjackey avatar May 04 '23 14:05 rjackey