Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Callbaks, Passing by reference, setting output
Date: Fri, 14 Sep 2007 14:05:07 +0000 (UTC)
Organization: King's College London
Lines: 17
Message-ID: <fce4ei$k20$1@fred.mathworks.com>
References: <fcdm6c$vk$1@fred.mathworks.com> <fcdmnr$6j9$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1189778707 20544 172.30.248.36 (14 Sep 2007 14:05:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 14 Sep 2007 14:05:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477
Xref: news.mathworks.com comp.soft-sys.matlab:428548



Pass the handle of the text box and have the callback read 
the text e.g.

var1=text(0.1,0.1,'MyText');
var2=pi;
set(obj,'Callback', {@myCallback, var1, var2})



function(hObj, EventData, var1, var2)
str=get(var1,'String');
.
.
.
end