<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Continuous slider callback</title> <atom:link href="http://undocumentedmatlab.com/blog/continuous-slider-callback/feed/" rel="self" type="application/rss+xml" /><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/</link> <description>Charting Matlab's unsupported hidden underbelly</description> <lastBuildDate>Thu, 09 Feb 2012 09:23:08 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.1</generator> <item><title>By: claus</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-72274</link> <dc:creator>claus</dc:creator> <pubDate>Thu, 26 Jan 2012 16:34:47 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-72274</guid> <description>Hi, thank you for your help!I turned my sliders into continuous just by adding two simple mods:first, add the following 2 lines to your xxxxxx_OpeningFcn:
&lt;pre lang=&quot;matlab&quot;&gt;
hListener=addlistener(handles.sliderN, &#039;ContinuousValueChange&#039;, @sliderN_Callback);
setappdata(handles.sliderN,&#039;myListener&#039;,hListener);
&lt;/pre&gt;then, add the following 3 lines to your sliderN_Callback:
&lt;pre lang=&quot;matlab&quot;&gt;
if ~(exist(&#039;handles&#039;,&#039;var&#039;))
handles=guidata(hObject);
end
&lt;/pre&gt;
It works like a charm!Thank you!</description> <content:encoded><![CDATA[<p>Hi, thank you for your help!</p><p>I turned my sliders into continuous just by adding two simple mods:</p><p>first, add the following 2 lines to your xxxxxx_OpeningFcn:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">hListener=addlistener<span style="color: #080;">&#40;</span>handles.<span style="">sliderN</span>, <span style="color:#A020F0;">'ContinuousValueChange'</span>, @sliderN_Callback<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">setappdata</span><span style="color: #080;">&#40;</span>handles.<span style="">sliderN</span>,<span style="color:#A020F0;">'myListener'</span>,hListener<span style="color: #080;">&#41;</span>;</pre></div></div><p>then, add the following 3 lines to your sliderN_Callback:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">if</span> ~<span style="color: #080;">&#40;</span><span style="color: #0000FF;">exist</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'handles'</span>,<span style="color:#A020F0;">'var'</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>
     handles=guidata<span style="color: #080;">&#40;</span>hObject<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">end</span></pre></div></div><p>It works like a charm!</p><p>Thank you!</p> ]]></content:encoded> </item> <item><title>By: Elise</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-45061</link> <dc:creator>Elise</dc:creator> <pubDate>Sat, 28 May 2011 00:14:39 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-45061</guid> <description>Thanks! Handle.listener worked great!</description> <content:encoded><![CDATA[<p>Thanks! Handle.listener worked great!</p> ]]></content:encoded> </item> <item><title>By: Matlab continuous slider callback &#171; Desperate Engineers Blog</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-42575</link> <dc:creator>Matlab continuous slider callback &#171; Desperate Engineers Blog</dc:creator> <pubDate>Wed, 04 May 2011 08:53:55 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-42575</guid> <description>[...] ([uicontrol(&#039;Style&#039;,&#039;slider&#039;, ...]) in a MATLAB GUI. Thanks to the posting of Yair Altman on this topic (on his awesome Undocumented Matlab Blog which you shoudl definitely check out), I had no problem [...]</description> <content:encoded><![CDATA[<p>[...] ([uicontrol(&#039;Style&#039;,&#039;slider&#039;, ...]) in a MATLAB GUI. Thanks to the posting of Yair Altman on this topic (on his awesome Undocumented Matlab Blog which you shoudl definitely check out), I had no problem [...]</p> ]]></content:encoded> </item> <item><title>By: Jonas</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-40728</link> <dc:creator>Jonas</dc:creator> <pubDate>Thu, 21 Apr 2011 14:09:01 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-40728</guid> <description>A short update form my side - as I now run on R2011a.I used to run a listener as proposed (R2010a/b) in the post the following way:
&lt;pre lang=&quot;matlab&quot;&gt;lh = addlistener(sliderhandle, &#039;ActionEvent&#039;,@MyCallback);
&lt;/pre&gt;The new Version of Matlab (R2011a) gives me a warning that I should not use this method anymore but rather use: a &quot;ContinuousValueChange&quot; Event.
So I end up with:
&lt;pre lang=&quot;matlab&quot;&gt;lh = addlistener(sliderhandle, &#039;ContinuousValueChange&#039;,@MyCallback);
&lt;/pre&gt;
which works pretty smooth. However, besides of that one-time-console-warning I have not found any documented information about this &quot;ContinuousValueChange&quot;-event or other hidden events...Best, Jonas</description> <content:encoded><![CDATA[<p>A short update form my side &#8211; as I now run on R2011a.</p><p>I used to run a listener as proposed (R2010a/b) in the post the following way:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">lh = addlistener<span style="color: #080;">&#40;</span>sliderhandle, <span style="color:#A020F0;">'ActionEvent'</span>,@MyCallback<span style="color: #080;">&#41;</span>;</pre></div></div><p>The new Version of Matlab (R2011a) gives me a warning that I should not use this method anymore but rather use: a &#8220;ContinuousValueChange&#8221; Event.<br
/> So I end up with:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">lh = addlistener<span style="color: #080;">&#40;</span>sliderhandle, <span style="color:#A020F0;">'ContinuousValueChange'</span>,@MyCallback<span style="color: #080;">&#41;</span>;</pre></div></div><p>which works pretty smooth. However, besides of that one-time-console-warning I have not found any documented information about this &#8220;ContinuousValueChange&#8221;-event or other hidden events&#8230;</p><p>Best, Jonas</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-39082</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Thu, 07 Apr 2011 10:36:05 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-39082</guid> <description>@Jonas - these are essentially the same, except that &lt;i&gt;&lt;b&gt;addlistener&lt;/b&gt;&lt;/i&gt; adds the listener in a hidden property called &lt;b&gt;Listeners__&lt;/b&gt;, rather than in the similarly-hidden &lt;b&gt;ApplicationData&lt;/b&gt; property (which is what &lt;i&gt;&lt;b&gt;setappdata&lt;/b&gt;&lt;/i&gt; does).
&lt;pre lang=&#039;matlab&#039;&gt;
&gt;&gt; get(handles.mySlider, &#039;Listeners__&#039;)
ans =
handle.listener
&lt;/pre&gt;The actual place where the listener is stored does not matter. It is only important to store listeners together with the listened object, so that they both have exactly the same life-span. Both of these methods do that, by storing the listener in one of the object handle&#039;s properties.The source code for &lt;i&gt;&lt;b&gt;addlistener&lt;/b&gt;&lt;/i&gt; is not available in the latest Matlab releases (it&#039;s implemented as an internal function), but it is available and inspectable in Matlab releases up to 2008 (e.g., &lt;code&gt;C:\Program Files\Matlab\R2008a\toolbox\matlab\uitools\private\addlistener.m&lt;/code&gt;). This source code is not long (only ~30 code lines) and it&#039;s interesting, so I recommend looking at it.</description> <content:encoded><![CDATA[<p>@Jonas &#8211; these are essentially the same, except that <i><b>addlistener</b></i> adds the listener in a hidden property called <b>Listeners__</b>, rather than in the similarly-hidden <b>ApplicationData</b> property (which is what <i><b>setappdata</b></i> does).</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">&gt;&gt; <span style="color: #0000FF;">get</span><span style="color: #080;">&#40;</span>handles.<span style="">mySlider</span>, <span style="color:#A020F0;">'Listeners__'</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ans</span> =
	<span style="color: #0000FF;">handle.<span style="">listener</span></span></pre></div></div><p>The actual place where the listener is stored does not matter. It is only important to store listeners together with the listened object, so that they both have exactly the same life-span. Both of these methods do that, by storing the listener in one of the object handle&#8217;s properties.</p><p>The source code for <i><b>addlistener</b></i> is not available in the latest Matlab releases (it&#8217;s implemented as an internal function), but it is available and inspectable in Matlab releases up to 2008 (e.g., <code>C:\Program Files\Matlab\R2008a\toolbox\matlab\uitools\private\addlistener.m</code>). This source code is not long (only ~30 code lines) and it&#8217;s interesting, so I recommend looking at it.</p> ]]></content:encoded> </item> <item><title>By: Jonas</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-39078</link> <dc:creator>Jonas</dc:creator> <pubDate>Thu, 07 Apr 2011 09:56:38 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-39078</guid> <description>Dear Yair
Your blog is just wonderful and helps me a lot these days in getting somewhere with my thesis. Thank your for your good work!Regarding the continuous slider callback, I wonder what the difference between
&lt;pre lang=&quot;matlab&quot;&gt;
hListener = handle.listener(handles.mySlider,&#039;ActionEvent&#039;,@mySliderMoved);
setappdata(handles.mySlider,&#039;mySliderListener&#039;,hListener);
&lt;/pre&gt; and &lt;pre lang=&quot;matlab&quot;&gt;
hListener = addlistener(handles.mySlider, &#039;ActionEvent&#039;, @mySliderMoved);
&lt;/pre&gt;
exactly is...?Best,
JonasPS. looking forward to your relevations of 2011a - coming tomorrow :)</description> <content:encoded><![CDATA[<p>Dear Yair<br
/> Your blog is just wonderful and helps me a lot these days in getting somewhere with my thesis. Thank your for your good work!</p><p>Regarding the continuous slider callback, I wonder what the difference between</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">hListener = <span style="color: #0000FF;">handle.<span style="">listener</span></span><span style="color: #080;">&#40;</span>handles.<span style="">mySlider</span>,<span style="color:#A020F0;">'ActionEvent'</span>,@mySliderMoved<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">setappdata</span><span style="color: #080;">&#40;</span>handles.<span style="">mySlider</span>,<span style="color:#A020F0;">'mySliderListener'</span>,hListener<span style="color: #080;">&#41;</span>;</pre></div></div><p> and</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">hListener = addlistener<span style="color: #080;">&#40;</span>handles.<span style="">mySlider</span>, <span style="color:#A020F0;">'ActionEvent'</span>, @mySliderMoved<span style="color: #080;">&#41;</span>;</pre></div></div><p>exactly is&#8230;?</p><p>Best,<br
/> Jonas</p><p>PS. looking forward to your relevations of 2011a &#8211; coming tomorrow <img
src='http://undocumentedmatlab.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Florin</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-36081</link> <dc:creator>Florin</dc:creator> <pubDate>Tue, 08 Mar 2011 23:17:31 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-36081</guid> <description>Yair,Thank you for your quick reply. That worked.
Hope you can maintain this site for a long time.
I wish you all the best.Regards,
Florin</description> <content:encoded><![CDATA[<p>Yair,</p><p>Thank you for your quick reply. That worked.<br
/> Hope you can maintain this site for a long time.<br
/> I wish you all the best.</p><p>Regards,<br
/> Florin</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-36006</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Tue, 08 Mar 2011 07:36:29 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-36006</guid> <description>@Florin - you probably have the same problem as Cemil and the solution is similar. In your slider callback, instead of using a simple &lt;b&gt;&lt;i&gt;imagesc&lt;/i&gt;&lt;/b&gt;, directly specify the parent axes:&lt;pre lang=&quot;matlab&quot;&gt;imagesc(&#039;Parent&#039;,handles.axes1, &#039;XData&#039;,xdata, &#039;YData&#039;,ydata, ...);&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>@Florin &#8211; you probably have the same problem as Cemil and the solution is similar. In your slider callback, instead of using a simple <b><i>imagesc</i></b>, directly specify the parent axes:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">imagesc<span style="color: #080;">&#40;</span><span style="color:#A020F0;">'Parent'</span>,handles.<span style="">axes1</span>, <span style="color:#A020F0;">'XData'</span>,xdata, <span style="color:#A020F0;">'YData'</span>,ydata, <span style="color: #F0F;">...</span><span style="color: #080;">&#41;</span>;</pre></div></div>]]></content:encoded> </item> <item><title>By: Florin</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-35982</link> <dc:creator>Florin</dc:creator> <pubDate>Tue, 08 Mar 2011 00:59:53 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-35982</guid> <description>Hi,I have been reading this post, but I still have a problem. I am reading and a .tif file and display slices of it with &lt;i&gt;&lt;b&gt;imagesc&lt;/b&gt;&lt;/i&gt;. I am trying to continuously update this images when moving the slider. I have the same problem as Cemil : a new windows appears and the &lt;i&gt;&lt;b&gt;imagesc&lt;/b&gt;&lt;/i&gt;s are updated in that new figure. As soon as I release the mouse button the intended figure inside my GUI is also updated. I checked the &lt;strong&gt;HandleVisibility&lt;/strong&gt; parameter. I also tried to set the handle with
&lt;pre lang=&quot;matlab&quot;&gt;
figure(get(handles.axes1,&#039;Parent&#039;));
&lt;/pre&gt;
Any suggestions for me, pls ?Thank you.
Florin</description> <content:encoded><![CDATA[<p>Hi,</p><p>I have been reading this post, but I still have a problem. I am reading and a .tif file and display slices of it with <i><b>imagesc</b></i>. I am trying to continuously update this images when moving the slider. I have the same problem as Cemil : a new windows appears and the <i><b>imagesc</b></i>s are updated in that new figure. As soon as I release the mouse button the intended figure inside my GUI is also updated. I checked the <strong>HandleVisibility</strong> parameter. I also tried to set the handle with</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">figure</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">get</span><span style="color: #080;">&#40;</span>handles.<span style="">axes1</span>,<span style="color:#A020F0;">'Parent'</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;</pre></div></div><p>Any suggestions for me, pls ?</p><p>Thank you.<br
/> Florin</p> ]]></content:encoded> </item> <item><title>By: Cemil Kirbas</title><link>http://undocumentedmatlab.com/blog/continuous-slider-callback/#comment-10644</link> <dc:creator>Cemil Kirbas</dc:creator> <pubDate>Wed, 02 Jun 2010 13:59:23 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-10644</guid> <description>Thank you very much Yair. That was a great help. I changed HandleVisibility of the figure from its default value &#039;callback&#039; to &#039;on&#039; and the problem is solved. I appreciate your help.Best regards,Cemil.</description> <content:encoded><![CDATA[<p>Thank you very much Yair. That was a great help. I changed HandleVisibility of the figure from its default value &#8216;callback&#8217; to &#8216;on&#8217; and the problem is solved. I appreciate your help.</p><p>Best regards,</p><p>Cemil.</p> ]]></content:encoded> </item> </channel> </rss>

<!-- W3 Total Cache: Minify debug info:
Engine:             disk: basic
Theme:              b7666
Template:           single
-->
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: undocumentedmatlab.com @ 2012-02-09 05:02:40 -->

<!-- W3 Total Cache: Page cache debug info:
Engine:             disk: enhanced
Cache key:          blog/continuous-slider-callback/feed/_index.xml_gzip
Caching:            enabled
Status:             not cached
Creation Time:      0.694s
Header info:
X-Pingback:         http://undocumentedmatlab.com/blog/xmlrpc.php
Set-Cookie:         wpgb_visit_last_php-default=1328788960; expires=Fri, 08-Feb-2013 12:02:40 GMT; path=/
Link:               <http://undocumentedmatlab.com/?p=1052>; rel=shortlink
Content-Type:       text/xml; charset=UTF-8
Last-Modified:      Thu, 09 Feb 2012 12:02:40 GMT
Vary:               Accept-Encoding, Cookie
Expires:            Thu, 09 Feb 2012 13:02:40 GMT
Pragma:             public
Cache-Control:      public, must-revalidate, proxy-revalidate
Etag:               9bdc78a08bc7aabe12dfd97419b58453
Content-Encoding:   gzip
-->
