Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Building a calculator, confused with GUI ButtonDownFct
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!