Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ButtonDownFcn Callback for Axes Objects
Date: Mon, 1 Dec 2008 19:58:02 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 13
Message-ID: <gh1fka$egk$1@fred.mathworks.com>
References: <ggg9ng$c4m$1@fred.mathworks.com> <gghamu$oe5$1@fred.mathworks.com> <ggi6ji$n95$1@fred.mathworks.com> <ggjpbb$c5d$1@fred.mathworks.com> <ggjvea$sfh$1@fred.mathworks.com> <ggtuje$50j$1@fred.mathworks.com> <gh19j7$2o0$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228161482 14868 172.30.248.38 (1 Dec 2008 19:58:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Dec 2008 19:58:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:504204


"Malcolm Lidierth" <ku.ca.lck@htreidil.mloclam> wrote in message <gh19j7$2o0$1@fred.mathworks.com>...
> Ryan
> The hittest() command is present in R2008b. It has been around for a long time although it is still undocumented. How it differs, if at all, from
> get(gcf, 'CurrentObject') I do not know.
> ML

If memory serves me and I'm not mistaken, the difference is that get(gcf, 'CurrentObject') returns the latest object selected, whereas hittest (and the semi-documented overobj function) return the topmost object beneath the mouse cursor, even if it has not been selected.

If you're interested in checking the current position in the WindowButtonMotionFcn callback, you should use either overobj() (which has some severe limitations, but is outside the scope here), hittest(), or get(gcf,'CurrentPoint') (note: CurrentPoint, not CurrentObject).

Yair Altman
UndocumentedMatlab.com (actual content sometime in the future...)