Clear Filters
Clear Filters

Reference to non-existent field when opening gui with toolbar icone

2 views (last 30 days)
Hello i have a gui that i can open thought the open folder icone in the toolbar and when i do it this way i have the following error
Error using kgexec4 (line 463)
Error evaluating 'OpenFcn' callback of ParamNor block (mask)
'Model_ACWA_1/paramètres de norme'.
Caused by:
Error using kgexec4 (line 463)
Reference to non-existent field 'X'.
Error while evaluating uipushtool ClickedCallback
the problem comes from the gui file where the pushbutton is used because :
%bouton OK
handles.button = uicontrol(h0,'Style','pushbutton',...
'BackgroundColor',gris,...
'Position',[27 0.5 16 2],...
'String','OK',...
'Tag','NormeOK',...
'Callback',@buttonCB);
guidata(h0,handles);
handles.X=0;
.
.
.
function buttonCB(ButtonH, EventData)
handles = guidata(ButtonH);
handles.X = 1;
guidata(ButtonH, handles);
end
end
when the handles.X=0 is usualy above the handles.button but when it is and i open the gui with the icone in the toolbar all the gui callbacks won't works but when it's in this position only the callback to the function buttonCB won't work if anyone can help.

Answers (1)

Walter Roberson
Walter Roberson on 24 Nov 2022
If you have created a gui using GUIDE then you must run the m file not open the fig file. The handles structure does not get created unless you run the m file

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!