Pushbutton inside a while loop

1 view (last 30 days)
Lucas Berso
Lucas Berso on 18 May 2015
Commented: Joseph Cheng on 18 May 2015
Hello, I was working on a game and I have the following problem:
My idea is to create a gui where the user writes an edit text and after pushing the button, the program keeps that input and continues working with it. However, as I want to make this inside a while loop I don't know how to structure it.
My ideal structure would be the following: 1. Typing the input in the edit text gap. 2. Pushing the button. 3. Call a function which works with that input. 4. Repeat the same process until I decide to stop because of the while loop condition that I have set before pushing the button.
I really don't know how to work with this kind of situations in a gui interface and I hope you could help me. Thanks in advance!
  2 Comments
Arunkumar Muthukumaran
Arunkumar Muthukumaran on 18 May 2015
Hello, Create a edit text and Push button in GUI. In push button callback, read the string in edit text and use it in your while loop to process it. Is this what you were looking for?
Joseph Cheng
Joseph Cheng on 18 May 2015
Can you explain what the process and update from the pushbutton is supposed to do? The implementation really is dependent on what you want to do in the while loop. When you say repeat the same process what happens? do you stop the current one and start it again with the new edit text? or does it include the editions into the process which you didn't tell us.

Sign in to comment.

Answers (0)

Categories

Find more on Environment and Settings 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!