How can I have a GUI that is like a telephone keypad where the numbers pressed are stored in a static text box, there is a clear key, and a backspace key to manipulate the text box?
Show older comments
It should operate like a cellphone where one can type in a phone number and the numbers are displayed and can be cleared and/or deleted/backspace. I have most of the code already just need some help storing multiple numbers in the static text box and then manipulating them.
Answers (1)
Joseph Cheng
on 31 Mar 2014
Edited: Joseph Cheng
on 31 Mar 2014
without diving into your code too much and next time warn us that the computer will beep. Wasn't prepared for that. Anyways, to say display it like a cellphone why not read in the value of handles.keyF and then append it with the data for that key?
temp = get(handles.keyF,'String');
set(handles.keyF, 'String', [temp m]);
and then for delete key
temp = get(handles.keyF,'String');
temp(end) =[]; %make the last/end entry blank [];
set(handles.keyF, 'String', [temp]);
and then clear would just clear out the string for keyF
2 Comments
Brendan Dsouza
on 18 Sep 2022
I agree that beep scared the shit out of me
Brendan Dsouza
on 18 Sep 2022
your display function isn't working
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!