User`s guide
Making Multiple GUIs Work Together
toolPicker_CreateFcn(hObject, eventdata, handles)
toolPalette_SelectionChangeFcn(hObject, eventdata, ha ndles)
figure_CloseRequestFcn(hObject, eventdata, handles)
[iconEditor, iconE ditorHandles] = getIconEditor(handles)
cdata = pencilToolCallback(handles, toolstruct, cdata, point)
cdata = eraserToolCallback(handles, toolstruct, cdata, point)
cdata = bucketToolCallback(handles, toolstruct, cdata, point)
cdata = fillWithColor(cdata, rows, cols, color, row, col, seedcolor)
cdata = colorpickerToolCallback(handles, toolstruct, cdata, point)
Opening the Icon Editor and the Tool and Color Palettes
When you open the Icon Editor, the Tool Palette and C olor Palette
automatically start up. The palettes are children of the Icon E ditor and
communicate as described here:
• Property/value pairs — Send data into a newly invoked or exis ting GUI
by passing it as input arguments.
• GUIdata—Storedatainthe
handles structure of a G UI; can communicate
data within one GUI or between several GUIs.
• Output — Return data from the invoked GUI; this is used to communicate
data, such as the
handles structure of the invoked GUI, back to the
invoking GUI.
The Icon Editor is passed into the Tool Palette, and Color Palette as a
property/value (p/v) pair that allows the T ool and Color Palettes to make calls
back into the Icon Editor. The output value from calling both of the palettes
is the handle to their GUI figures. These figure handles are saved into the
handles structure of Icon Editor:
% in Icon Editor
function guide_Ico n Editor_OpeningFcn(hObject,eventdata,handle s,varargin)
.
.
.
handles.colorPalette = guide_colorpalette('iconEditor',hObject);
handles.toolPalette = guide_toolpalette('i conEditor',hObject);
9-35