Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ButtonDownFcn Callback for Axes Objects
Date: Fri, 28 Nov 2008 22:22:02 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 11
Message-ID: <ggpqu9$ecj$1@fred.mathworks.com>
References: <ggg9ng$c4m$1@fred.mathworks.com> <gghamu$oe5$1@fred.mathworks.com> <ggi6ji$n95$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 1227910922 14739 172.30.248.37 (28 Nov 2008 22:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 28 Nov 2008 22:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:503717


"Thiago " <thiago@mathworks.com> wrote in message <ggi6ji$n95$1@fred.mathworks.com>...
> Steve,
> 
> Yes, I have images on my axes. Thank you for the suggestions, by the way. Unfortunately the problem is not completely resolved. I have results with set(gcf,'WindowButtonDownFcn', '...callback goes here....') inside the CreateFcn of an axis object. However, I can't do this for more than one axis object. For this reason, I may use push buttons instead. 
> 
> PS: If you know a way to overcome this problem, please let me know.

Get the position of the button click,
cp = get(gcf, 'CurrentPoint')
Get the Position properties of all of the the axes objects
Test if cp is within an axes object and execute code accordingly.