Reference to non-existent field when opening gui with toolbar icone
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Walter Roberson
le 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
0 commentaires
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!