Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: uisetcolor + activeX ->figure without focus, if compiled
Date: Wed, 19 Aug 2009 15:06:01 +0000 (UTC)
Organization: Georgia Institute of Technology
Lines: 26
Message-ID: <h6h4co$leh$1@fred.mathworks.com>
References: <gpdqsp$29p$1@fred.mathworks.com> <gtphhd$ggg$1@fred.mathworks.com> <h61v4h$hgj$1@fred.mathworks.com> <h6gbut$mco$1@fred.mathworks.com> <h6gck2$59g$1@fred.mathworks.com> <h6h023$lj$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250694361 21969 172.30.248.37 (19 Aug 2009 15:06:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 19 Aug 2009 15:06:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:564465


"Corbin Holland" <cholland.nospam@opticalsciences.com> wrote in message <h6h023$lj$1@fred.mathworks.com>...
> "Andreas Greuer" <greuer@remove-this-gmx.de> wrote in message <h6gck2$59g$1@fred.mathworks.com>...
> > Just compiled the application with the old compiler version 4.6 (R2007a). And there it works fine. 
> > -> So it seems to be a problem of the new compiler version 4.10 (R2009a)
> 
> I ran into the same problem a few months back.  I solved it by adding a tiny pause after the uisetcolor call.  I just wrapped the uisetcolor call and added a slight delay like this:
> 
> function newcolor = colorChooser( varargin )
> 
> % This is just a wrapper for the uisetcolor function.  I made it so I could add the pause to account
> % for a bug in the compiled version for 2009a.  
> 
> newcolor = uisetcolor(varargin{:});
> 
> if (isdeployed)
>    pause(.1); % necessary for compiled version 2009a or the dialog disappears but prog thinks modal is active
>               % and you can no longer click on anything at all
> end
> 
> 
> let me know if any of you come up with a better solution.
> 
> - Corbin


Not sure if it will make a difference, but you could try using a JColorChooser instead of uisetcolor. See the demo file in my file "rgb2name" on the file exchange for an example of how it works.