Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Tempoarily Disable a GUI while a function is running
Date: Wed, 12 Sep 2007 00:37:16 -0400
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <fc7qds$6pt$1@fred.mathworks.com>
References: <fc71me$ouq$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1189571836 6973 144.212.105.187 (12 Sep 2007 04:37:16 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 Sep 2007 04:37:16 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Xref: news.mathworks.com comp.soft-sys.matlab:428003



"Adam " <not.my.email@mathworks.com> wrote in message 
news:fc71me$ouq$1@fred.mathworks.com...
>I have a complicated function that take awhile to run.  I
> have set up a GUI using GUIDE to handle different variables.
> The problem I have is the user can click the run button, or
> a slider control multiple times.  This calls multiple
> instances of the function, with bizarre results.  In a
> couple cases enough functions are called to crash Matlab.
>
> I tried making the waitbar() modal.  However, you can still
> sneak in 2-3 button presses.  Even worse, if you click a
> slider control it locks and then proceeds to repeatedly push
> the slider button (calling a function instance every time)
> until it reaches the max limit!!!

*snip*

Read this section from the documentation that discusses Callback 
Interruption:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/creating_guis/bq61qtj-1.html

Note this is from the MATLAB 7.5 (R2007b) documentation, but I don't believe 
there was any change in this functionality from MATLAB 7.4 (R2007a) to 7.5.

-- 
Steve Lord
slord@mathworks.com