Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Axes tools in GUI
Date: Tue, 1 Jul 2008 21:15:29 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 27
Message-ID: <g4e6ph$i2v$1@canopus.cc.umanitoba.ca>
References: <g414n2$no7$1@fred.mathworks.com> <g4e2su$iu2$1@fred.mathworks.com> <g4e3ef$d6o$1@canopus.cc.umanitoba.ca> <g4e4qq$lan$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1214946929 18527 192.70.172.160 (1 Jul 2008 21:15:29 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Tue, 1 Jul 2008 21:15:29 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:476983



In article <g4e4qq$lan$1@fred.mathworks.com>,
David  <daviddoria@gmail.com> wrote:
>oh, ok -

>what if I wanted to send something else though besides the
>src and evt?  Like some parameter that I wish to have the
>value "5".  Is there a way to call GetPoint(src, evt, 5)?


set(handle,appropriateCallbackName,{@GetPoint,5});

Matlab will see that the callback is a cell array
and will do roughly the equivilent of

cb = get(handle,appropriateCallBackName);
cb{1}(src,evt,cb{2:end});

Except that first it will set the internal variables for
gcf, gcbo and the like, and the internal variables for
the figure CurrentPoint and so on. If you don't make use of those
items in your callback, you can call your callback "manually"
passing handle as the src and passing an appropriate structure
or [] for evt.
-- 
  "It is surprising what a man can do when he has to, and how
  little most men will do when they don't have to."
                                              -- Walter Linn