User`s guide

9 Managing and Sh aring Application Data in GUIDE
handles.mSelectedColor =color;
.
.
.
guidata(hObject, handles);
Call the publicized function from the Icon Editor, setting the initial color
to
'red':
% in Icon E dito r
function gui de_i coneditor_OpeningFcn(hO bject, ...
eventdata, ha ndle s, varargin)
.
.
.
handles.colorPalette = guide_co lorpalette('iconEditor' , hObject);
.
.
.
colorPalette = handles.colorPalette;
colorPaletteHandles = guidata(c olorPalette);
colorPaletteHandles.setColor(colorP alette, [1 0 0]);
.
.
.
% Update handles structure
guidata(hObject, handles);
Accessing the Color Palette’s Current Color from the Icon Editor
TheColorPaletteinitializesthecurrentcolordata:
%in colorPalett e
function gui de_c olorpalette_OpeningFcn( hObject, ...
eventdata, ha ndle s, varargin)
handles.output = hObject;
.
.
.
handles.mSelectedColor = [0 0 0];
.
9-38