Date: Nov 22, 2012 1:53 PM
Subject: GUI related questions
Hey guys, I figured I'd ask for some help here since it would take me a really long time to remember and figure out how GUI and it's functions work.
1. I have a pop-up menu with 3 selections. When each one is selected, I want it's inputs to be stored in a variable, when a user enter a value into a textbox. Each of those 3 values will be used to calculate a result of some equation when a user presses 'calculate' push button. I was thinking maybe have 3 text boxes, all hidden and on top of each other, until a user selects one of the choices of the pop up menu. But how can I store these values when a user goes from one option to the next? What's the syntax to make a textbox visible/invisible?
2. For the other inputs, I just have text boxes with a label next to them. To store a number as a variable I use this line a=str2num(get(handles.input1,'string')). what is the syntax to display an answer in another text box, I tried set(handles.output,'string',variblewithastring) but I get an error.
3. To make sure that each text box has an input, I can use isempty(variable) right? what about to make sure that all the inputs are numbers, and not letters? How do I display a pop up message saying which box has an incorrect input format?
any help is really appreciated. Thanks