Path: news.mathworks.com!not-for-mail
From: "Phil Goh" <pgnator@googlemail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Linking a Slider to Edit Box
Date: Tue, 4 Sep 2007 08:22:04 +0000 (UTC)
Organization: Oxford Brookes Univ
Lines: 22
Message-ID: <fbj4jc$8ro$1@fred.mathworks.com>
References: <fbhk1s$jq7$1@fred.mathworks.com> <fbhkhv$rtg$1@fred.mathworks.com> <fbhmt4$86u$1@fred.mathworks.com> <fbhusg$f5f$1@fred.mathworks.com>
Reply-To: "Phil Goh" <pgnator@googlemail.com>
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 1188894124 9080 172.30.248.37 (4 Sep 2007 08:22:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 4 Sep 2007 08:22:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 215551
Xref: news.mathworks.com comp.soft-sys.matlab:426846


> What about something like this:
> 
> (in the edit callback)
> textValue = str2num( get(editHandle,'String') )
> set(sliderHandle,'Value',textValue)
> 
> (in the slider callback)
> sliderValue = num2str( get(sliderHandle,'Value') )
> set(editHandle,'String', sliderValue)
> 
> Is that what you're looking for?
> Lorenzo


That is similar to what I've ended up doing. I store the hObjects of the slider 
and edit box in the handle in their respective CreateFcn. This didn't work 
before and hence my post, but since then I've discovered I need to insert a 
call to guidata, which updates the value of handle.

So all works now. Thanks a bunch.

Phil