From: red on
I have a strange problem involving a GUI containing a "run" button and an axes.

The idea is:
press "run" button ->
enter a loop ->
use "pause" at each iteration to let user look at drawing in GUI axes -->
user presses any key to go to next iteration.

At i = 1, there is no problem.
User done looking at drawing -> keystroke -> i = 2.

The problem is at i = 2.
The user must mouse-click somewhere on the GUI,
OR ELSE keystrokes are not recognized.
(It's as though the user has to reactivate the GUI window,
although not clear why the GUI would have lost focus,
or why that should matter for the keystroke???!).

For iterations i = 3 to the end,
this problem does not happen.

I can send code privately if you think you could help.
(About 14 kb)
From: red on
Very strange. The solution is at
http://www.mathworks.com/matlabcentral/newsreader/view_thread/235825

The trick is to do this:

set(hObject,'Enable','off')
drawnow
.... body of function
set(hObject,'Enable','on')
 | 
Pages: 1
Prev: dendrogram label
Next: Question about crop image