Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: uisetcolor + activeX ->figure without focus, if compiled
Date: Fri, 13 Mar 2009 14:54:01 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 11
Message-ID: <gpds29$l8b$1@fred.mathworks.com>
References: <gpdqsp$29p$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 1236956041 21771 172.30.248.37 (13 Mar 2009 14:54:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Mar 2009 14:54:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:524622


> I'm using uisetcolor in combination with an activeX. 
> If my application is compiled, I'm loosing the focus of the figure and can't get it back, after using the uisetcolor command.
[snip]
> f=figure;
>  uicontrol('Parent',f,'Style', 'pushbutton',...
>     'Position', [0 0 130 30],'String','Color',...
>     'CallBack',@color_Callback);

You can use figure(f) to programmatically regain figure focus, or uicontrol(h) to set the focus to a specific uicontrol handle (which you should get from the initial uicontrol invocation). I believe that the latter option (uicontrol(h)) is not documented in uicontrol's help section but it is documented in the detailed doc.

Yair Altman