Pushbutton is not responsive until I move figure that pushbutton is attached to
Afficher commentaires plus anciens
I am encountering some strange behavior probably due to my lack of experience in designing small GUIs via Matlab.
I built a small menu for selecting some parameters related to the analysis I am running. This menu includes an "Accept" and "Cancel" button at the bottom of the figure.
function acceptButton(hObject, eventdata, handles)
%% set pars from menu AFTER button press
pars=setExptParsFromMenu(menu,pars);
close(menu.FigH)
quitProgram=false;
end
function cancelButton(hObject, eventdata, handles)
%% set pars from menu AFTER button press
close(menu.FigH)
quitProgram=true;
end
Upon hitting accept/cancel, I close the figure in order to move on with the program:
uiwait(menu.FigH)
All of my menu's fields--which include dropdown lists and text edit fields--work 100% as expected (code not shown). However, there is an odd "bug" with the accept/cancel buttons. The buttons do not work when I try to use them via their default location (bottom-right corner of my monitor). They do not even show the blue borderline that typically surrounds them when you hover a mouse over a pushbutton. If I move the figure a couple inches to the left, they suddenly work again. If I move the figure back to its initial location, they no longer work.
It's almost as if there is an invisible object between these buttons and the mouse, but I have no reason to think that any invisible object would be present. I do not use. Any ideas?
5 commentaires
Adam Danz
le 30 Juil 2019
Where does the "menu" and "pars" variables come from? Is this the complete code for those functions? Are you getting any error messages?
Chris Endemann
le 31 Juil 2019
Modifié(e) : Chris Endemann
le 31 Juil 2019
Adam Danz
le 31 Juil 2019
But I'm asking where do those variables come from? They aren't being passed to your functions and I don't see them being declared as global variables (which is good). In general, variables in one function workspace are not available to other functions. Are those functions nested functions? If so, that may point to some problems within you GUI which I'm assuming was produced in GUIDE.
Chris Endemann
le 31 Juil 2019
Modifié(e) : Chris Endemann
le 31 Juil 2019
Adam Danz
le 1 Août 2019
Any way you could attach all necessary files so we can run this and reproduce the problem? We'd need "addDataTypeFields", "addPCAFields", and anything else currently missing.
Réponses (0)
Catégories
En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!