Strange Push Button Issue

8 次查看(过去 30 天)
Kevin Gaukel
Kevin Gaukel 2014-10-3
I have written several pieces of GUI code which all run quite well.
The only issue, and it is mostly a "maddening" issue more than a functional issue, is that I always seem to need to press the push button on my dialog boxes twice before they execute. It doesn't matter if the program is large or small - the button seems to be unresponsive until I press it a second time.
None of my other controls have this issue.
Does anyone have any suggestions? Thank you.
  2 个评论
Geoff Hayes
Geoff Hayes 2014-10-3
Kevin - what are the other types of widgets on your GUI - edit text boxes, uitables, or ..? And by dialog boxes, do you mean actual dialogs outside of your GUI, or just push buttons within the GUI? Have you put breakpoints in the callback for the button to verify that it is only on the second press that it is being called?
A recent question at pushbutton callback function reacts only after second press discussed a similar issue that seemed to occur only when the user pressed the button after editing/selecting a cell in the uitable. I couldn't reproduce the problem (R2014a, OS X 10.8.5) but others could and had seen the problem before.
Kevin Gaukel
Kevin Gaukel 2014-10-3
编辑:Kevin Gaukel 2014-10-3
The GUI I am working on now is relatively simple as it contains an "OK" button
and two tables. Per your previous discussion, I merely update the tables, press OK, and the output of the program is a cell array containing matrices of the two arrays. These are then read into another more complex program which I cannot display because it is company proprietary.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2014-10-3
I've seen this before when my user is in a uitable, editing it, and clicks the OK button to accept the table as is. For some reason they have to click twice. It seems like all the first click does is to change focus away from the table (take it out of editing mode), and it needs another click to actually do the pushbutton callback. I don't know why. It's been talked about before and I don't recall any workaround. I feel your pain.
  1 个评论
Kevin Gaukel
Kevin Gaukel 2014-10-3
That is pretty much exactly what is happening. Most of my windows edit tables containing plot scales of multiple measurements. When I modify the scale on one cell of the table on my GUI, I have to push the button twice. Thanks for letting me know that I am not crazy. (Or at least not any more crazy than I already am).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by