Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rjackey opened this issue May 4, 2023 · 0 comments
Assignees

Comments

@rjackey
Copy link
Member

rjackey commented May 4, 2023

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 = obj@matlab.ui.componentcontainer.ComponentContainer(args{:});

            % Ensure background color listener has been generated
            if isempty(obj.BackgroundColorListener)
                obj.updateBackgroundColorableComponents()
                obj.listenForBackgroundChange();
            end

        end %function
@rjackey rjackey self-assigned this May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant