Conflict between dialog box and button?
이전 댓글 표시
I am writing a tic tac toe game using a graph. I used dialog boxes to prompt each user to input their move. I added a button to the graph that can be pressed to clear the board and restart the game. However, the button cannot be pressed while a dialog box is open, and as soon as one user inputs their move a new dialog box pops up for the next move. Essentially, I cannot press the button until all the moves have been made and there are no more dialog boxes. Is there any way to allow the button to be pressed while there is a dialog box open?

채택된 답변
추가 답변 (2개)
ES
2017년 3월 14일
Please check if you have used modal property in the dialog box?
%An example which blocks execution until the user responds:
uiwait(msgbox('String','Title','modal'));
댓글 수: 1
Walter Roberson
2017년 3월 14일
It looks to me that they are using inputdlg(), which defaults to 'WindowStyle', 'modal'
Image Analyst
2017년 3월 14일
0 개 추천
Why not simply have 9 pushbuttons instead of a graph? It would be so much easier. When you press the button, simply change the String on the button from blank to X or O depending on whose turn it is.
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!