Pushbutton inside a while loop
이전 댓글 표시
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
Arunkumar Muthukumaran
2015년 5월 18일
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
2015년 5월 18일
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Desktop에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!