Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Building a calculator, confused with GUI ButtonDownFct
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I am building a calculator from scratch and Im having trouble with the ButtonPressFct. I am trying to make it so I store a variable ONLY IF you press a certain button. In this case, Im trying to do it for the '+' button. Heres what I have and it is not working
function togglebutton12_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of togglebutton12
global n1
if (get(handles.text1,'ButtonDownFct') ~= 'on'
n1 = get(handles.text1,'String');
else
n1 = 0;
end
textString = get(handles.text1,'String');
textString = '';
set(handles.text1,'String',textString)
0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!