<?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: Uicontrol callbacks</title>
	<atom:link href="http://undocumentedmatlab.com/blog/uicontrol-callbacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/</link>
	<description>Charting Matlab's unsupported hidden underbelly</description>
	<pubDate>Fri, 12 Mar 2010 16:50:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-7989</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-7989</guid>
		<description>In answer to a &lt;a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/252988" rel="nofollow"&gt;CSSM question&lt;/a&gt; asking for an explanation of the memory leak problem when setting Matlab callbacks directly on the Java object (rather than on their &lt;b&gt;&lt;i&gt;handle&lt;/i&gt;&lt;/b&gt;), there is an &lt;a target="_blank" href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/broifyr-1.html#brrxpv8-1" rel="nofollow"&gt;official MathWorks post on this&lt;/a&gt;.

Also see the following related CSSM threads &lt;a target="_blank" href="http://mathforum.org/kb/message.jspa?messageID=5863891&amp;tstart=0" rel="nofollow"&gt;here&lt;/a&gt; and &lt;a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/240336" rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>In answer to a <a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/252988" rel="nofollow">CSSM question</a> asking for an explanation of the memory leak problem when setting Matlab callbacks directly on the Java object (rather than on their <b><i>handle</i></b>), there is an <a target="_blank" href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/broifyr-1.html#brrxpv8-1" rel="nofollow">official MathWorks post on this</a>.</p>
<p>Also see the following related CSSM threads <a target="_blank" href="http://mathforum.org/kb/message.jspa?messageID=5863891&#038;tstart=0" rel="nofollow">here</a> and <a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/240336" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Continuous slider callback &#124; Undocumented Matlab</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-6993</link>
		<dc:creator>Continuous slider callback &#124; Undocumented Matlab</dc:creator>
		<pubDate>Mon, 08 Feb 2010 09:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-6993</guid>
		<description>[...] explained in an earlier article, Matlab uicontrols are basically Java Swing objects that possess a large number of useful callbacks [...]</description>
		<content:encoded><![CDATA[<p>[...] explained in an earlier article, Matlab uicontrols are basically Java Swing objects that possess a large number of useful callbacks [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Detecting window focus events &#124; Undocumented Matlab</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-2562</link>
		<dc:creator>Detecting window focus events &#124; Undocumented Matlab</dc:creator>
		<pubDate>Wed, 09 Sep 2009 20:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-2562</guid>
		<description>[...] The list of standard Swing callbacks was detailed in my earlier article about uicontrol callbacks, which is also relevant for Java windows [...]</description>
		<content:encoded><![CDATA[<p>[...] The list of standard Swing callbacks was detailed in my earlier article about uicontrol callbacks, which is also relevant for Java windows [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Setting listbox mouse actions &#124; Undocumented Matlab</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-2103</link>
		<dc:creator>Setting listbox mouse actions &#124; Undocumented Matlab</dc:creator>
		<pubDate>Thu, 13 Aug 2009 22:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-2103</guid>
		<description>[...] Matlab listbox uicontrol can be modified to detect mouse events for right-click context menus, dynamic tooltips etc. [...]</description>
		<content:encoded><![CDATA[<p>[...] Matlab listbox uicontrol can be modified to detect mouse events for right-click context menus, dynamic tooltips etc. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EditorMacro - assign a keyboard macro in the Matlab editor &#124; Undocumented Matlab</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-1497</link>
		<dc:creator>EditorMacro - assign a keyboard macro in the Matlab editor &#124; Undocumented Matlab</dc:creator>
		<pubDate>Wed, 01 Jul 2009 19:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-1497</guid>
		<description>[...] EditorMacro is a new utility that enables setting keyboard macros in the Matlab editor. In a nutshell, EditorMacro sets the KeyPressedCallback property (explained in a previous post) for each of the editor’s document panes, to an internal function. [...]</description>
		<content:encoded><![CDATA[<p>[...] EditorMacro is a new utility that enables setting keyboard macros in the Matlab editor. In a nutshell, EditorMacro sets the KeyPressedCallback property (explained in a previous post) for each of the editor’s document panes, to an internal function. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-709</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Sat, 16 May 2009 17:34:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-709</guid>
		<description>@Junziyang - when creating a component you get a handle to the Java object that you can then use in Matlab using the built-in get/set functions etc. However, to prevent all sorts of issues (memory leaks, inaccessible callbacks etc.), you should normally use the returned object within a Matlab handle(), like so:

javaObj = JavaClass(constructor_params);
objHandle = handle(javaObj,'CallbackProperties');
% from now on, use get(objHandle,...) or set(objHandle,...) or objHandle.method()

Yair</description>
		<content:encoded><![CDATA[<p>@Junziyang - when creating a component you get a handle to the Java object that you can then use in Matlab using the built-in get/set functions etc. However, to prevent all sorts of issues (memory leaks, inaccessible callbacks etc.), you should normally use the returned object within a Matlab handle(), like so:</p>
<p>javaObj = JavaClass(constructor_params);<br />
objHandle = handle(javaObj,&#8217;CallbackProperties&#8217;);<br />
% from now on, use get(objHandle,&#8230;) or set(objHandle,&#8230;) or objHandle.method()</p>
<p>Yair</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: junziyang</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-686</link>
		<dc:creator>junziyang</dc:creator>
		<pubDate>Sat, 16 May 2009 01:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-686</guid>
		<description>Is there anyway to wrap a JAVA component into a MATALB handle? I mean to retrun a matlab-like handle(a number) to the user after the creation of the Java component in MATLAB. While, only part of the properties of the JAVA object can be accessed through the handle.
thanks.</description>
		<content:encoded><![CDATA[<p>Is there anyway to wrap a JAVA component into a MATALB handle? I mean to retrun a matlab-like handle(a number) to the user after the creation of the Java component in MATLAB. While, only part of the properties of the JAVA object can be accessed through the handle.<br />
thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-414</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Wed, 06 May 2009 19:27:12 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-414</guid>
		<description>Thanks Sleesh. 

1. try setting the 'enable' property of the nodes

2. in the old uitable, there are several ways to set the background color:
    a) Use each column's cell renderer:

cr = javax.swing.table.DefaultTableCellRenderer;
cr.setForeground(java.awt.Color.red);
cr.setBackground(java.awt.Color(0.2,0.3,0.8)); %dark-blue
jtable.getColumnModel.getColumn(1).setCellRenderer(cr);  % 0=first column; 1=second column; ...

    b) use HTML data in the table: &lt;html&gt;&lt;font color="red"&gt;123.456 ... - this is good for read-only cells but not good for editable cells because when you edit the cell you'll see the HTML code...

There is no easy way to set row colors - either set HTML colors programmatically or create a custom TableCellRenderer Java class

Yair</description>
		<content:encoded><![CDATA[<p>Thanks Sleesh. </p>
<p>1. try setting the &#8216;enable&#8217; property of the nodes</p>
<p>2. in the old uitable, there are several ways to set the background color:<br />
    a) Use each column&#8217;s cell renderer:</p>
<p>cr = javax.swing.table.DefaultTableCellRenderer;<br />
cr.setForeground(java.awt.Color.red);<br />
cr.setBackground(java.awt.Color(0.2,0.3,0.8)); %dark-blue<br />
jtable.getColumnModel.getColumn(1).setCellRenderer(cr);  % 0=first column; 1=second column; &#8230;</p>
<p>    b) use HTML data in the table: &lt;html&gt;&lt;font color=&#8221;red&#8221;&gt;123.456 &#8230; - this is good for read-only cells but not good for editable cells because when you edit the cell you&#8217;ll see the HTML code&#8230;</p>
<p>There is no easy way to set row colors - either set HTML colors programmatically or create a custom TableCellRenderer Java class</p>
<p>Yair</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sleesh</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-388</link>
		<dc:creator>sleesh</dc:creator>
		<pubDate>Tue, 05 May 2009 20:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-388</guid>
		<description>Hi Yair.

I would just like to leave you a note, that I am always impressed by your comments, notes and posts on comp.soft-sys.matlab or TMW file-exchange.

Seems as if you now decided to publish some deeper insights to the matter - great work!

Since you asked for some input what people are interested in - my 2-cents:
1. How to disable/enable single nodes of uitree?
2. How to set the background color of the uitable, a single row, a single column (possible in 2008a and later, but impossible for me in 2007b)?</description>
		<content:encoded><![CDATA[<p>Hi Yair.</p>
<p>I would just like to leave you a note, that I am always impressed by your comments, notes and posts on comp.soft-sys.matlab or TMW file-exchange.</p>
<p>Seems as if you now decided to publish some deeper insights to the matter - great work!</p>
<p>Since you asked for some input what people are interested in - my 2-cents:<br />
1. How to disable/enable single nodes of uitree?<br />
2. How to set the background color of the uitable, a single row, a single column (possible in 2008a and later, but impossible for me in 2007b)?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
