c = uicontrol()
c = uicontrol(propertyName, propertyValue)
c = uicontrol(parent)
c = uicontrol(parent, propertyName, propertyValue, ...)
uicontrol(c)
| Parameter | Description |
|---|---|
| parent | figure graphics object. |
| propertyName | property name: a scalar string or row vector character. |
| propertyValue | property value: a value compatible with property name. |
| c | an User Interface control object. |
| Parameter | Description |
|---|---|
| c | an User Interface control object. |
c = uicontrol creates a push button, which is the default user interface control, within the current figure and returns the associated uicontrol object. If no figure is currently open, Nelson generates one using the figure function.
c = uicontrol(propertyName, propertyValue) creates a user interface control with properties defined by one or more name-value pair arguments. For instance, specifying 'Style', 'button' will create a button.
c = uicontrol(parent) creates the default user interface control (push button) within the specified parent container, rather than defaulting to the current figure.
c = uicontrol(parent, propertyName, propertyValue) creates a user interface control within the specified parent container, allowing you to define its properties using one or more name-value pair arguments.
uicontrol(c) sets the focus to a previously defined user interface control, bringing it to the forefront for user interaction.
See uicontrol properties for the complete property list.
f = figure;
b = uicontrol(f,Style='pushbutton', String='Click Me', Position=[100 100 60 30], Callback='disp(''Hello World!'')')
f = figure();
h = uicontrol(Style='checkbox', String='Click Me!', Position=[100, 100, 100, 50]);
f = figure();
h = uicontrol(Style='edit', String='Click Me!', Position=[100, 100, 100, 50]);
hFig = figure(Position=[100, 100, 300, 300]);
imgSize = 50; % Size of the image
[X, Y] = meshgrid(1:imgSize, 1:imgSize);
CData = cat(3, X/imgSize, Y/imgSize, zeros(imgSize));
CData = im2double(CData); % Ensure the image is of type double
hButton = uicontrol(Style='pushbutton', Position=[100, 100, 100, 100], CData=CData, String='Click Me!');
addpath([modulepath('graphics','root'), '/examples/uicontrol'])
edit uicontrol_demo
uicontrol_demo
addpath([modulepath('graphics','root'), '/examples/uicontrol'])
edit uicontrol_demo_interruptible
uicontrol_demo_interruptible
| Version | Description |
|---|---|
| 1.7.0 | initial version |
| 1.14.0 | Units property added |