Prev: Fast find
Next: Keyboard input error!
From: Walter Roberson on 7 Jun 2010 15:28 loli J wrote: > Walter Roberson <roberson(a)hushmail.com> wrote in message >> The usual procedure is something like this, >> >> set(Button_handle, 'enable', 'off') >> old_pointer = get(gcf, 'Pointer'); >> set(gcf, 'Pointer', 'watch') >> >> Then when the work is finished, >> >> set(gcf, 'Pointer', old_pointer) >> set(Button_handle, 'enable', 'on') > I tried this solution and it works > but I think that I need to disable the pressed button and all other > buttons in the gui > until the process of the clicked button is finished The call to set(Button_handle, 'enable', 'off') is the one that disables the pressed button. Another way of coding it, if you are in the callback for that button, is set(src, 'enable', 'off') and then at the end, set(src, 'enable', 'on') If you want to disable everything, then you could instead set(gcf, 'WindowStyle', 'modal') at the top of the callback routine, and then set(gcf, 'WindowStyle', 'normal') at the bottom of the routine. Possibly you might also have to set all the uicontrol in that figure to be Enable off, but this mechanism would save you from having to save and restore the state of all uicontrol in all other figures. |