<?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="https://undocumentedmatlab.com/articles/continuous-slider-callback/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/continuous-slider-callback?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=continuous-slider-callback</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Thu, 23 Feb 2017 16:18:26 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Felix		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-401022</link>

		<dc:creator><![CDATA[Felix]]></dc:creator>
		<pubDate>Thu, 23 Feb 2017 16:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-401022</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-401021&quot;&gt;Felix&lt;/a&gt;.

May add a listener to ButtonDownFcn/ButtonUpFcn ? I tried various events but only got errors like: 
&lt;pre lang=&quot;matlab&quot;&gt;Event &#039;ButtonDownFcn&#039; is not defined for class
&#039;matlab.ui.control.UIControl&#039;.&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-401021">Felix</a>.</p>
<p>May add a listener to ButtonDownFcn/ButtonUpFcn ? I tried various events but only got errors like: </p>
<pre lang="matlab">Event 'ButtonDownFcn' is not defined for class
'matlab.ui.control.UIControl'.</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Felix		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-401021</link>

		<dc:creator><![CDATA[Felix]]></dc:creator>
		<pubDate>Thu, 23 Feb 2017 16:14:11 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-401021</guid>

					<description><![CDATA[Hello,

I have some performance issues when using the addlistener in addition to WindowButtonMotionFcn:
&lt;pre lang=&quot;matlab&quot;&gt;
function temp
   F = figure();
   set(F,&#039;WindowButtonMotionFcn&#039;,@Cursor);
   H = uicontrol(F,&#039;Style&#039;,&#039;slider&#039;);
   addlistener(H, &#039;Value&#039;, &#039;PostSet&#039;,@getSliderValue);
end
function getSliderValue(hObj,event)
   get(event.AffectedObject,&#039;Value&#039;)
end
function Cursor(hObj,event)
   disp(&#039;move&#039;)
end
&lt;/pre&gt;

Is there a way to suppress the WindowButtonMotionFcn of the figure during the continuous slider callback? I tried using the WindowButtonDownFcn/WindowButtonUpFcn to remove/add the WindowButtonMotionFcn, but WindowButtonDownFcn nor ButtonDownFcn is called when the slider property &#039;Enable&#039; is set &#039;on&#039;. Using &#039;inactive&#039; first would a require a second click to tell Matlab to drag the slider...

&lt;pre lang=&quot;matlab&quot;&gt;
function temp
   F = figure();
   set(F,&#039;WindowButtonMotionFcn&#039;,@Cursor);
   set(F,&#039;WindowButtonDownFcn&#039;,@ButtonDown);
   set(F,&#039;WindowButtonUpFcn&#039;,@ButtonUp);
   H = uicontrol(F,&#039;Style&#039;,&#039;slider&#039;);
   addlistener(H, &#039;Value&#039;, &#039;PostSet&#039;,@getSliderValue);
end
function getSliderValue(hObj,event)
   get(event.AffectedObject,&#039;Value&#039;)
end
function Cursor(hObj,event)
   disp(&#039;move&#039;)
end
function ButtonDown(hObj,event)
   set(gcf,&#039;WindowButtonMotionFcn&#039;,[]);
end
function ButtonUp(hObj,event)
   set(gcf,&#039;WindowButtonMotionFcn&#039;,@Cursor);
end
&lt;/pre&gt;
Thanks, Felix]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>I have some performance issues when using the addlistener in addition to WindowButtonMotionFcn:</p>
<pre lang="matlab">
function temp
   F = figure();
   set(F,'WindowButtonMotionFcn',@Cursor);
   H = uicontrol(F,'Style','slider');
   addlistener(H, 'Value', 'PostSet',@getSliderValue);
end
function getSliderValue(hObj,event)
   get(event.AffectedObject,'Value')
end
function Cursor(hObj,event)
   disp('move')
end
</pre>
<p>Is there a way to suppress the WindowButtonMotionFcn of the figure during the continuous slider callback? I tried using the WindowButtonDownFcn/WindowButtonUpFcn to remove/add the WindowButtonMotionFcn, but WindowButtonDownFcn nor ButtonDownFcn is called when the slider property &#8216;Enable&#8217; is set &#8216;on&#8217;. Using &#8216;inactive&#8217; first would a require a second click to tell Matlab to drag the slider&#8230;</p>
<pre lang="matlab">
function temp
   F = figure();
   set(F,'WindowButtonMotionFcn',@Cursor);
   set(F,'WindowButtonDownFcn',@ButtonDown);
   set(F,'WindowButtonUpFcn',@ButtonUp);
   H = uicontrol(F,'Style','slider');
   addlistener(H, 'Value', 'PostSet',@getSliderValue);
end
function getSliderValue(hObj,event)
   get(event.AffectedObject,'Value')
end
function Cursor(hObj,event)
   disp('move')
end
function ButtonDown(hObj,event)
   set(gcf,'WindowButtonMotionFcn',[]);
end
function ButtonUp(hObj,event)
   set(gcf,'WindowButtonMotionFcn',@Cursor);
end
</pre>
<p>Thanks, Felix</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-365587</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 30 Dec 2015 16:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-365587</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-365572&quot;&gt;SeifEddine&lt;/a&gt;.

Thanks Seif - I clarified the post text accordingly.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-365572">SeifEddine</a>.</p>
<p>Thanks Seif &#8211; I clarified the post text accordingly.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: SeifEddine		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-365572</link>

		<dc:creator><![CDATA[SeifEddine]]></dc:creator>
		<pubDate>Wed, 30 Dec 2015 16:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-365572</guid>

					<description><![CDATA[Matlab R2015a:
&lt;pre lang=&#039;matlab&#039;&gt;
hProp = findprop(hSlider,&#039;Value&#039;);
hListener = addlistener(hSlider,hProp,&#039;PostSet&#039;,@myCbFcn);
setappdata(hSlider,&#039;sliderListener&#039;,hListener);
&lt;/pre&gt;

Cordially.]]></description>
			<content:encoded><![CDATA[<p>Matlab R2015a:</p>
<pre lang='matlab'>
hProp = findprop(hSlider,'Value');
hListener = addlistener(hSlider,hProp,'PostSet',@myCbFcn);
setappdata(hSlider,'sliderListener',hListener);
</pre>
<p>Cordially.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Armindo		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353425</link>

		<dc:creator><![CDATA[Armindo]]></dc:creator>
		<pubDate>Tue, 21 Jul 2015 16:21:12 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353425</guid>

					<description><![CDATA[Thank you for the help. 
I think that I can solve the problem if I can converte the x coordenate obtained thru the get(gca&#039;CurrentPoint&#039;) to the slider scale. There is a easy way to do this?

kind regards]]></description>
			<content:encoded><![CDATA[<p>Thank you for the help.<br />
I think that I can solve the problem if I can converte the x coordenate obtained thru the get(gca&#8217;CurrentPoint&#8217;) to the slider scale. There is a easy way to do this?</p>
<p>kind regards</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353411</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 21 Jul 2015 09:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353411</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353409&quot;&gt;daniel&lt;/a&gt;.

@Daniel - this is one of the reasons that I use &lt;i&gt;&lt;b&gt;try/catch&lt;/b&gt;&lt;/i&gt; rather than &lt;i&gt;&lt;b&gt;if/else&lt;/b&gt;&lt;/i&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353409">daniel</a>.</p>
<p>@Daniel &#8211; this is one of the reasons that I use <i><b>try/catch</b></i> rather than <i><b>if/else</b></i></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: daniel		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353409</link>

		<dc:creator><![CDATA[daniel]]></dc:creator>
		<pubDate>Tue, 21 Jul 2015 08:58:17 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353409</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353378&quot;&gt;Yair Altman&lt;/a&gt;.

Yes!  Fewh, my code will still works with some changes.

Actually, my code was written defensively, checking explicitly that &#039;ContinuousValueChange&#039; is in the list of events in a handle... the result is that the code refuses to create the listener to an apparently non available-event.

Thanks for pointing me to your list of events in HG2: it is the only source of information I can use to harness events! 

... I really wonder why TMW has hidden these events: I don&#039;t see any advantage, and it makes life much harder...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353378">Yair Altman</a>.</p>
<p>Yes!  Fewh, my code will still works with some changes.</p>
<p>Actually, my code was written defensively, checking explicitly that &#8216;ContinuousValueChange&#8217; is in the list of events in a handle&#8230; the result is that the code refuses to create the listener to an apparently non available-event.</p>
<p>Thanks for pointing me to your list of events in HG2: it is the only source of information I can use to harness events! </p>
<p>&#8230; I really wonder why TMW has hidden these events: I don&#8217;t see any advantage, and it makes life much harder&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353378</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Mon, 20 Jul 2015 18:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353378</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353364&quot;&gt;daniel&lt;/a&gt;.

@Daniel - the &lt;code&gt;ContinuousValueChange&lt;/code&gt; event still exists. It is simply hidden, but should be fully functional:
&lt;pre lang=&#039;matlab&#039;&gt;addlistener(hSlider, &#039;ContinuousValueChange&#039;, @(h,e)disp(&#039;Changing!&#039;))&lt;/pre&gt;

Other hidden events of sliders include: &lt;code&gt;Action, KeyPress, KeyRelease, LocationChanged, SizeChanged, ButtonDown, Reset&lt;/code&gt;

Additional information: http://undocumentedmatlab.com/blog/undocumented-hg2-graphics-events]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353364">daniel</a>.</p>
<p>@Daniel &#8211; the <code>ContinuousValueChange</code> event still exists. It is simply hidden, but should be fully functional:</p>
<pre lang='matlab'>addlistener(hSlider, 'ContinuousValueChange', @(h,e)disp('Changing!'))</pre>
<p>Other hidden events of sliders include: <code>Action, KeyPress, KeyRelease, LocationChanged, SizeChanged, ButtonDown, Reset</code></p>
<p>Additional information: <a href="http://undocumentedmatlab.com/blog/undocumented-hg2-graphics-events" rel="ugc">http://undocumentedmatlab.com/blog/undocumented-hg2-graphics-events</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: daniel		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353364</link>

		<dc:creator><![CDATA[daniel]]></dc:creator>
		<pubDate>Mon, 20 Jul 2015 14:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353364</guid>

					<description><![CDATA[Well, for some reason TMW has elliminated the &#039;ContinuousValueChange&#039; event for the sliders in R2015a, an it will not work in this version.... Even worse, there is no comparable event that one could think of using.

That&#039;s a pity, I had many code based in this approach, which is know perfectly useless :-/]]></description>
			<content:encoded><![CDATA[<p>Well, for some reason TMW has elliminated the &#8216;ContinuousValueChange&#8217; event for the sliders in R2015a, an it will not work in this version&#8230;. Even worse, there is no comparable event that one could think of using.</p>
<p>That&#8217;s a pity, I had many code based in this approach, which is know perfectly useless :-/</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353103</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 15 Jul 2015 10:30:13 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1052#comment-353103</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353096&quot;&gt;Amindo&lt;/a&gt;.

@Amindo - perhaps &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/14984-scrollplot-scrollable-x-y-axes&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;ScrollPlot&lt;/a&gt; on the File Exchange will help you. If not, then contact me offline (by email) for a a consulting proposal.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/continuous-slider-callback#comment-353096">Amindo</a>.</p>
<p>@Amindo &#8211; perhaps <a href="http://www.mathworks.com/matlabcentral/fileexchange/14984-scrollplot-scrollable-x-y-axes" target="_blank" rel="nofollow">ScrollPlot</a> on the File Exchange will help you. If not, then contact me offline (by email) for a a consulting proposal.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
