User`s guide
Add Components to a Programmatic GUI
Note You can also use an image as a label. See “Add an Image to a Push
Button” on page 11-26 for more information.
Edit Text
The following statement creates an edit text component with handle eth:
eth = uicontrol(fh,'Style','edit', ...
'String','Enter your name here. ',...
'Position',[30 50 130 20]);
The first argument, fh, specifies the handle of the parent figure. You can also
specify the parent as a panel or button group. See “Panel” o n page 11-35 and
“Button Group” on page 11-36 for more information.
The
Style property, edit, specifies the u ser interface control as an edit text
component.
The
String property defines the text that appears in the component.
To enable multiple-line input,
Max - Min mustbegreaterthan1,asinthe
following statement. MATLAB software wraps the string if necessary.
eth = uicontrol(fh,'Style','edit', ...
'String','Enter your name and address here.',. ..
'Max',2,'Min',0,...
'Position',[30 20 130 80]);
11-17