MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE User's Guide Page 367

  • Download
  • Add to my manuals
  • Print
  • Page
    / 759
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 366
Making Multiple GUIs Work Together
.
.
.
% Update handles structure
guidata(hObject, h andles);
Setting the Initial Color on the Color Palette
After you create all three GUIs, you need to set the initial color. When you
invoke the Color Palette from the Icon Editor, the Color Palette passes a
function handle that tells the Icon Editor how to set the initial color. This
function handle is stored in its
handles structure. You can retrieve the
handles structure from the figure to w hich the Color P alette outputs the
handle:
% in colorPalette
function gui de_c olorpalette_OpeningFcn( hObject, ...
eventdata, ha ndle s, varargin)
handles.output = hObject;
.
.
.
% Set the initial palette c olor to black
handles.mSelectedColor = [0 0 0];
% Publish the function setS electedColor
handles.setColor = @setSelectedColor;
.
.
.
% Update handles structure
guidata(hObject, handles);
% in colorPalette
function set Sele ctedColor(hObject, color)
handles = guidata(hObject);
.
.
.
9-37
Page view 366
1 2 ... 362 363 364 365 366 367 368 369 370 371 372 ... 758 759

Comments to this Manuals

No comments