Path: news.mathworks.com!not-for-mail
From: "Titus" <titus.edelhofer@mathworks.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I give focus to a figure?
Date: Mon, 29 Oct 2007 10:03:00 +0100
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <fg47k5$bvd$1@fred.mathworks.com>
References: <fg3s2p$jgd$1@fred.mathworks.com>
NNTP-Posting-Host: 172.16.75.150
X-Trace: fred.mathworks.com 1193648581 12269 172.16.75.150 (29 Oct 2007 09:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Oct 2007 09:03:01 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: news.mathworks.com comp.soft-sys.matlab:435027




"Jochen Smolka" <ja511@gmx.de> schrieb im Newsbeitrag 
news:fg3s2p$jgd$1@fred.mathworks.com...
> Hi,
>
> in my application I have a large number of buttons and an
> axis object in a figure. After each button press I would
> like to return focus to the figure, so that key presses are
> evaluated by the figure's KeyPressFcn. Is there a way to do
> this programmatically?
>
> Thanks,
>
> Jochen Smolka

Hi Jochen,
unfortunately the answer is no. But there is some sort of
workaround: instead of using the callback for the button, do
the following: set the button enable property to "inactive",
and use the buttondownfcn instead of the callback. This
way the button does not get the control so the figure stays
in control...

Titus