Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I give focus to a figure?
Date: Fri, 3 Oct 2008 06:57:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <gc4fnu$jvj$1@fred.mathworks.com>
References: <fg3s2p$jgd$1@fred.mathworks.com> <fg47k5$bvd$1@fred.mathworks.com> <fg6b09$4h$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 1223017022 20467 172.30.248.37 (3 Oct 2008 06:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 3 Oct 2008 06:57:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869189
Xref: news.mathworks.com comp.soft-sys.matlab:493439


I tried the solution with "buttonpressfunc" on an inactive button and this was not working. I guess the "buttonpressfunc" has to be caught at the figure level. Then you must determine if the mouse position is on top of the button.

I had a callback whenever the user press a button on the main figure and this was becoming innactive after pressing the button. I thus simply made a copy of the 'keypressfcn' content from the figure to the button and it works like a charm.

Arno