Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: ButtonDownFcn help
Date: Mon, 29 Oct 2007 17:27:16 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 21
Message-ID: <fg555k$j2e$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 1193678836 19534 172.30.248.37 (29 Oct 2007 17:27:16 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Oct 2007 17:27:16 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:435107



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.