setup
Class: matlab.ui.componentcontainer.ComponentContainer
Namespace: matlab.ui.componentcontainer
Syntax
setup(obj)
Description
setup(
sets the initial state of the UI
component. It executes once when the UI component object is created, after the UI
component's parent is assigned. Any other property values passed as name-value arguments
to the UI component's constructor method are assigned after the obj
)setup
method executes.
Define this method to execute initialization code for each new instance of your class. For example, you can use this method to create the underlying graphics objects and set initial property values on those objects.
Input Arguments
Examples
Tips
Do not call
drawnow
within thesetup
andupdate
methods of your UI component class. Such calls can cause unexpected screen updates in apps that use the UI component. Instead, rely on app creators (who use your component) to calldrawnow
in their app code when they need to trigger a screen update. These calls from outside the component code update all UI components in the app, including those created using theComponentContainer
class.
Version History
Introduced in R2020b