Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: counting mouse clicks
Date: Mon, 3 Nov 2008 15:02:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <gen3p9$ap0$1@fred.mathworks.com>
References: <ge5gs8$2m5$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 1225724521 11040 172.30.248.38 (3 Nov 2008 15:02:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 3 Nov 2008 15:02:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477385
Xref: news.mathworks.com comp.soft-sys.matlab:498643


What I do is put an invisible text in the GUI ('visible','off') and set its string to 0 ('string','0').

Then in the buttondownfcn, get the number from the text, increment it, and put the new value in its place. That way I don't have to worry about globals and whatnot.

Maybe there' a simpler way but this is fast and it works nice.