User`s guide
Add Components to the GUI
To display the & character in a label, use two & characters in the string.
The words
remove, default,andfactory (case sensitive) are reserved.
To use one of these as a label, prepend a backslash (
\) to the string. For
example,
\remove yields remove.
The push button accomm odates only a single line of text. If you specify
more than one line, only the first line is shown. If you create a push button
that is too narrow to accomm odate the specified
String, MATLAB software
truncates the string with an ellipsis.
• Ifyouwanttosetthepositionorsizeofthecomponenttoanexactvalue,
then modify its
Position property. See “Locate and Move Components” on
page 6-83 and “Resize Components” on page 6-86 for details.
• To add an image to a push button, assign the button’s
CData property an
m-by-n-by-3 array of R GB values that defines a truecolor image. You must
do this programmatically in the opening function of the GUI code file. For
example, the array
img defines a 16-by-64-by-3 truecolor image using
random values between 0 and 1 (generated by
rand).
img = rand(16,64,3);
set(handles.pushbutton1,'CData',img );
where pushbutton1 is the push button’s Tag property.
6-41