How to Add Each Click on Count Result Screen
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I would like to add extra mouse clicks to my count result screen. The related part of the code is:
Num = numel(s);
message= sprintf(' %i Seeds',Num);
h=msgbox(message);
What I have as a screen is:
I would like to add each mouse clicks to the count result screen. Clicking on image one time "152 Seeds" will be "153 Seeds". Two clicks 154 Seeds etc. and goes on. I have also reached to the manual click counter but it provides output on command line of matlab.
How could I add each click to the count result screen?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 9월 7일
msgbox returns a figure object. It would be possible to find the handle of the text string and update the String property of it. If you are doing a lot of updating then that would probably be best.
However, the easier way is to provide a title when you create the msgbox, and then each time you want to update the count, call msgbox again making sure that you provide the same title. The code will reuse the figure instead of creating a new figure in this case. It still involves more overhead than would be the case for updating the String property of the appropriate object, but it is easier to program.
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!