<?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: Inactive Control Tooltips &#038; Event Chaining	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=inactive-control-tooltips-event-chaining</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 06 Feb 2013 21:46:51 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-153304</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 06 Feb 2013 21:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-153304</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-153301&quot;&gt;Steven Ricks&lt;/a&gt;.

@Steven - you can use HTML formatting to achieve multi-line tooltips, as explained &lt;a href=&quot;http://undocumentedmatlab.com/blog/multi-line-tooltips/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-153301">Steven Ricks</a>.</p>
<p>@Steven &#8211; you can use HTML formatting to achieve multi-line tooltips, as explained <a href="http://undocumentedmatlab.com/blog/multi-line-tooltips/" target="_blank" rel="nofollow">here</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Steven Ricks		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-153301</link>

		<dc:creator><![CDATA[Steven Ricks]]></dc:creator>
		<pubDate>Wed, 06 Feb 2013 21:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-153301</guid>

					<description><![CDATA[Can you use this method for a multi-line tooltip on an inactive control?  The solution below, which works for Matlab&#039;s tooltipstring, does not work here.
&lt;pre lang=&quot;matlab&quot;&gt; 
tipString = sprintf(&#039;This is line 1\nThis is line 2&#039;);
javaMethodEDT(&#039;setToolTipText&#039;,jBtn,tipString);
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Can you use this method for a multi-line tooltip on an inactive control?  The solution below, which works for Matlab&#8217;s tooltipstring, does not work here.</p>
<pre lang="matlab"> 
tipString = sprintf('This is line 1\nThis is line 2');
javaMethodEDT('setToolTipText',jBtn,tipString);
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Multi-line tooltips &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-62208</link>

		<dc:creator><![CDATA[Multi-line tooltips &#124; Undocumented Matlab]]></dc:creator>
		<pubDate>Fri, 18 Nov 2011 00:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-62208</guid>

					<description><![CDATA[[...] I have already posted several articles about how to tweak tooltip contents (here, here, and here). Today I would like to expand on one of the aspects that were already covered [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] I have already posted several articles about how to tweak tooltip contents (here, here, and here). Today I would like to expand on one of the aspects that were already covered [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-28262</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 05 Jan 2011 18:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-28262</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-28243&quot;&gt;Malcolm Lidierth&lt;/a&gt;.

@Malcolm - Thanks for the pointer. It appears to be a very useful function for heavily-laden GUIs.

You might wish to modify the sigtools link at the bottom of your demo to a blue-underlined hyperlink. I posted an &lt;a target=&quot;_blank&quot; href=&quot;http://undocumentedmatlab.com/blog/button-customization/&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; that discussed this in 2009, as well as some code and discussion on &lt;a target=&quot;_blank&quot; href=&quot;https://www.mathworks.com/matlabcentral/newsreader/view_thread/164962&quot; rel=&quot;nofollow&quot;&gt;CSSM&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-28243">Malcolm Lidierth</a>.</p>
<p>@Malcolm &#8211; Thanks for the pointer. It appears to be a very useful function for heavily-laden GUIs.</p>
<p>You might wish to modify the sigtools link at the bottom of your demo to a blue-underlined hyperlink. I posted an <a target="_blank" href="http://undocumentedmatlab.com/blog/button-customization/" rel="nofollow">article</a> that discussed this in 2009, as well as some code and discussion on <a target="_blank" href="https://www.mathworks.com/matlabcentral/newsreader/view_thread/164962" rel="nofollow">CSSM</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-28243</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Wed, 05 Jan 2011 14:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-28243</guid>

					<description><![CDATA[Of some relevance to this, I have just posted a mouse motion handle class to the FEX. MouseMotionHandler is a MATLAB class that uses a MATLAB figure’s WindowButtonMotionFcn callback as a hook to extend button motion functionality to all handle graphics child objects of a figure including axes, lines, surfaces uipanels, uicontrols etc. 

&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/29913-mouse-motion-handler&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/29913-mouse-motion-handler&lt;/a&gt;

MouseMotionHandler provides an alternative to chaining callbacks or having a lengthy switch block in a WindowButtonMotionFcn callback to manage mouse motion effects. MouseMotionHandler puts its own callback into a figure&#039;s WindowButtonMotionFcn property. This callback manages the servicing of callbacks for other objects in the figure. It actively determines what is beneath the mouse then invokes a user-specified callback for that object, if one is set. Specify these objects and their mouse motion callbacks using the MouseMotionHandler add and put methods. MouseMotionHandler also extends the functionality of the standard WindowButtonMotionFcn callback: its internal logic discriminates between mouse entered, moved and exited calls.]]></description>
			<content:encoded><![CDATA[<p>Of some relevance to this, I have just posted a mouse motion handle class to the FEX. MouseMotionHandler is a MATLAB class that uses a MATLAB figure’s WindowButtonMotionFcn callback as a hook to extend button motion functionality to all handle graphics child objects of a figure including axes, lines, surfaces uipanels, uicontrols etc. </p>
<p><a href="http://www.mathworks.com/matlabcentral/fileexchange/29913-mouse-motion-handler" target="_blank" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/29913-mouse-motion-handler</a></p>
<p>MouseMotionHandler provides an alternative to chaining callbacks or having a lengthy switch block in a WindowButtonMotionFcn callback to manage mouse motion effects. MouseMotionHandler puts its own callback into a figure&#8217;s WindowButtonMotionFcn property. This callback manages the servicing of callbacks for other objects in the figure. It actively determines what is beneath the mouse then invokes a user-specified callback for that object, if one is set. Specify these objects and their mouse motion callbacks using the MouseMotionHandler add and put methods. MouseMotionHandler also extends the functionality of the standard WindowButtonMotionFcn callback: its internal logic discriminates between mouse entered, moved and exited calls.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas Goodwin		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9773</link>

		<dc:creator><![CDATA[Thomas Goodwin]]></dc:creator>
		<pubDate>Fri, 07 May 2010 12:30:07 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-9773</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9756&quot;&gt;Yair Altman&lt;/a&gt;.

Weird - you might be on to something, but for the life of me I am not seeing where the recursion is happening.  Actually, I&#039;m getting the feeling &quot;overhead&quot; is taking into consideration the time the GUI is usingto draw/refresh objects.  

If I replace all callbacks the GUI does with a function that draws/updates nothing to the screen (writes to the command window), the overhead of the events drops to nothing.  Yet if I tie it to the GUI updating callbacks, the only thing listed in the event and callback function is overhead.  

Maybe I need to look at a different way to draw the objects to the screen?  I&#039;m already re-using object handles, so I&#039;m not sure how much more optimized it can be - haha.

I guess I&#039;ll keep digging.  Thank you for the insight.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9756">Yair Altman</a>.</p>
<p>Weird &#8211; you might be on to something, but for the life of me I am not seeing where the recursion is happening.  Actually, I&#8217;m getting the feeling &#8220;overhead&#8221; is taking into consideration the time the GUI is usingto draw/refresh objects.  </p>
<p>If I replace all callbacks the GUI does with a function that draws/updates nothing to the screen (writes to the command window), the overhead of the events drops to nothing.  Yet if I tie it to the GUI updating callbacks, the only thing listed in the event and callback function is overhead.  </p>
<p>Maybe I need to look at a different way to draw the objects to the screen?  I&#8217;m already re-using object handles, so I&#8217;m not sure how much more optimized it can be &#8211; haha.</p>
<p>I guess I&#8217;ll keep digging.  Thank you for the insight.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9756</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 06 May 2010 20:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-9756</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9755&quot;&gt;Thomas Goodwin&lt;/a&gt;.

@Thomas - I suspect a case of endless recursion due to the contained object&#039;s listener triggering its parent which triggers back the child and so on until you reach your recursion limit (or something similar to that effect).

To test this hypothesis, try triggering some entirely external Matlab function (i.e., a function outside any class) and see whether the overhead remains. If my hunch is correct, then you&#039;ll see the overhead disappear. If not, then you&#039;ll have a very simple example to submit with your bug report to isupport@mathworks.com.

There are several ways to fix such recursive triggering. Here is a simple bare-bones implementation that you can use:

&lt;pre lang=&quot;matlab&quot;&gt;
function myCallbackFunc(hObject,hEventData,varargin)
  persistent inCallback
  try
    if ~isempty(inCallback)
      return;   % we&#039;re already in this callback: bail out
    else
      inCallback=1;
    end
    % The actual callback processing is done here 
  catch
     % Do some cleanup here
  end
  inCallback = [];
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9755">Thomas Goodwin</a>.</p>
<p>@Thomas &#8211; I suspect a case of endless recursion due to the contained object&#8217;s listener triggering its parent which triggers back the child and so on until you reach your recursion limit (or something similar to that effect).</p>
<p>To test this hypothesis, try triggering some entirely external Matlab function (i.e., a function outside any class) and see whether the overhead remains. If my hunch is correct, then you&#8217;ll see the overhead disappear. If not, then you&#8217;ll have a very simple example to submit with your bug report to <a href="mailto:isupport@mathworks.com">isupport@mathworks.com</a>.</p>
<p>There are several ways to fix such recursive triggering. Here is a simple bare-bones implementation that you can use:</p>
<pre lang="matlab">
function myCallbackFunc(hObject,hEventData,varargin)
  persistent inCallback
  try
    if ~isempty(inCallback)
      return;   % we're already in this callback: bail out
    else
      inCallback=1;
    end
    % The actual callback processing is done here 
  catch
     % Do some cleanup here
  end
  inCallback = [];
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas Goodwin		</title>
		<link>https://undocumentedmatlab.com/articles/inactive-control-tooltips-event-chaining#comment-9755</link>

		<dc:creator><![CDATA[Thomas Goodwin]]></dc:creator>
		<pubDate>Thu, 06 May 2010 20:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1153#comment-9755</guid>

					<description><![CDATA[I realize this isn&#039;t an undocumented feature, but I note you&#039;ve had a couple event/listener features explored here.  I&#039;ve implemented this construct as a means to have handle class objects interact with one another such that I can have one object contain many others.  I can then pass the container into a GUI which establishes listeners to the various contained object&#039;s events so that it will update the GUI as necessary.  The problem I&#039;ve run into is that the calls are computationally expensive (on the order of tenths of seconds or more per call), and according to the profile viewer, the time is entirely &quot;overhead&quot; in calling the listener - not the function the listener actually performs when the event is triggered as I was expecting.  I&#039;m not sure what is causing the latency, but it makes the whole interface crawl if the objects are highly active.  

It&#039;s a real shame too since the event/listener construct is a really elegant way to make one&#039;s objects interface-agnostic in a model-viewer relationship.  To give you an idea of scale, I have 50 objects with 3 events each being listened to by a single viewer.

Does anyone know of a way to speed up the event/listener overhead or make the profile cough up what &#039;overhead&#039; is actually taking so long?]]></description>
			<content:encoded><![CDATA[<p>I realize this isn&#8217;t an undocumented feature, but I note you&#8217;ve had a couple event/listener features explored here.  I&#8217;ve implemented this construct as a means to have handle class objects interact with one another such that I can have one object contain many others.  I can then pass the container into a GUI which establishes listeners to the various contained object&#8217;s events so that it will update the GUI as necessary.  The problem I&#8217;ve run into is that the calls are computationally expensive (on the order of tenths of seconds or more per call), and according to the profile viewer, the time is entirely &#8220;overhead&#8221; in calling the listener &#8211; not the function the listener actually performs when the event is triggered as I was expecting.  I&#8217;m not sure what is causing the latency, but it makes the whole interface crawl if the objects are highly active.  </p>
<p>It&#8217;s a real shame too since the event/listener construct is a really elegant way to make one&#8217;s objects interface-agnostic in a model-viewer relationship.  To give you an idea of scale, I have 50 objects with 3 events each being listened to by a single viewer.</p>
<p>Does anyone know of a way to speed up the event/listener overhead or make the profile cough up what &#8216;overhead&#8217; is actually taking so long?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
