Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news.in2p3.fr!in2p3.fr!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail
From: PB <pbodin@_REMOVE_THiS_kth.se>
Subject: Re: ButtonDownFcn help
Newsgroups: comp.soft-sys.matlab
References: <fg555k$j2e$1@fred.mathworks.com>
User-Agent: Pan/0.129 (Benson & Hedges Moscow Gold)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Lines: 32
Message-ID: <e6pVi.12485$ZA.7897@newsb.telia.net>
Date: Mon, 29 Oct 2007 17:53:14 GMT
NNTP-Posting-Host: 217.208.84.46
X-Complaints-To: abuse@telia.com
X-Trace: newsb.telia.net 1193680394 217.208.84.46 (Mon, 29 Oct 2007 18:53:14 CET)
NNTP-Posting-Date: Mon, 29 Oct 2007 18:53:14 CET
Organization: Telia Internet
Xref: news.mathworks.com comp.soft-sys.matlab:435111



Den Mon, 29 Oct 2007 17:27:16 +0000 skrev Matt Fig:

> Hello,
> 
> What exactly does this property do?  I want to make an edit box that has
> a default string in it when it first shows up.
>  When the user clicks inside the edit box, I want the
> default string to disappear, which I thought I could use the
> ButtonDownFcn to accomplish.  However, I cannot seem to make this
> ButtonDownFcn do anything at all.  What am I not understanding.  Here is
> one example.
> 
> 
> edt1 = uicontrol('style','edit','position',[30 30 90 20],...
>                  'string','String','ButtonDownFcn',...
>                  'set(edt1,''string'','' '')');
> 
> I also tried a function name, like @clc for the ButtonDownFcn, but that
> didn't work either.
> 
> Please tell me the correct way to use this ButtonDownFcn.  I know there
> may be another way to do what I want to do, but I also want to
> understand what this ButtonDownFcn does!  Thanks.

Matt, you are doing it right. It just doesn't behave the way you expect 
it to. To execute the ButtonDownFcn, either click in a five-pixel border 
around the uicontrol or right-click inside the control itself. ( I can't 
find a doc-reference but I know this is the way it works.)

HTH

PB