Navigation

Operators and Keywords

Function List:

C++ API

: hui = uicontrol (property, value, …)
: hui = uicontrol (parent, property, value, …)
: uicontrol (h)

Create a uicontrol object and return a handle to it.

uicontrols are used to create simple interactive controls such as push buttons, checkboxes, edit and list controls.

If parent is omitted then a uicontrol for the current figure is created. If no figure is available, a new figure is created first.

If parent is given then a uicontrol relative to parent is created.

Any provided property value pairs will override the default values of the created uicontrol object.

Uicontrol properties are documented at ‘Uicontrol Properties’.

Control of the type of uicontrol created is through the use of the style property. If no style property is provided, a push button will be created.

Valid styles for uicontrol are:

"checkbox"

Create a checkbox control that allows user on/off selection.

"edit"

Create an edit control that allows user input of single or multiple lines of text.

"listbox"

Create a listbox control that displays a list of items and allows user selection of single or multiple items.

"popupmenu"

Create a popupmenu control that displays a list of options that can be selected when the user clicks on the control.

"pushbutton"

Create a push button control that allows user to press to cause an action.

"radiobutton"

Create a radio button control intended to be used for mutually exclusive input in a group of radiobutton controls.

"slider"

Create a slider control that allows user selection from a range of values by sliding knob on the control.

"text"

Create a static text control to display single or multiple lines of text.

"togglebutton"

Create a toggle button control that appears like a push button but allows the user to select between two states.

Examples:

% create figure and panel on it
f = figure;
% create a button (default style)
b1 = uicontrol (f, "string", "A Button", "position",[10 10 150 40]);
% create an edit control
e1 = uicontrol (f, "style", "edit", "string", "editable text", "position",[10 60 300 40]);
% create a checkbox
c1 = uicontrol (f, "style", "checkbox", "string", "a checkbox", "position",[10 120 150 40]);

See also: figure, uipanel.

Package: octave