User`s guide

9 Managing and Sh aring Application Data in GUIDE
set(hObject, 'Position', [newX, newY, newW, newH]) ;
.
.
.
Initializing Text in the Text Change Dialog Box
1 To initialize the Tex t C hange dialog box text to the Change Me button’s
current text, get the main GUI’s
handles structure from its handle, passed
to the modal dialog box:
function change me_d ialog_OpeningFcn(hObjec t, ...
eventdata, ha ndle s, varargin)
mainGuiInput = find(strcmp(varargin, 'changeme_main'));
.
.
.
handles.changeMeMain = varargin {mainGuiInput+1};
2 Get the Change Me button’s String property and set the String property
of the edit box to that value in the dialog box
OpeningFcn.
% Obtain handles using GUIDAT A with the caller's handle
mainHandles = guidata(handles.chan geMeMain);
% Set the e dit text to the String of the main GUI's button
set(handles.editChangeMe, 'String', ...
get(mainHandles.buttonChangeMe, 'String'));
.
.
.
Canceling the Text Change Dialog Box
Call uiresume to close the modal dialog box if the user clicks Cancel or closes
the window. Do not modify the m ain GUI to close the modal dialog box.
function button Canc el_Callback(hObject, ...
eventdata, ha ndle s)
9-28