<?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: Customizing menu items part 1	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=customizing-menu-items-part-1</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 10 Sep 2019 18:01:02 +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/customizing-menu-items-part-1#comment-496761</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 10 Sep 2019 18:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-496761</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489&quot;&gt;Yaroslav&lt;/a&gt;.

A simple alternative that does not require any Java is to use simple HTML. For example:
&lt;pre lang=&quot;matlab&quot;&gt;uicontrol(&#039;Style&#039;,&#039;popup&#039;, &#039;String&#039;,{&#039;A&#039;, &#039;&lt;html&gt;B&lt;hr&gt;&#039;, &#039;C&#039;});&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489">Yaroslav</a>.</p>
<p>A simple alternative that does not require any Java is to use simple HTML. For example:</p>
<pre lang="matlab">uicontrol('Style','popup', 'String',{'A', '<html>B<hr />', 'C'});</html></pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yaroslav		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496760</link>

		<dc:creator><![CDATA[Yaroslav]]></dc:creator>
		<pubDate>Tue, 10 Sep 2019 17:52:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-496760</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489&quot;&gt;Yaroslav&lt;/a&gt;.

Hi Yair,

Unfortunately, &lt;b&gt;&lt;i&gt;javacomponent&lt;/i&gt;&lt;/b&gt; did not solve the problem. The culprit is actually the renderer, as suggested &lt;a href=&quot;http://esus.com/creating-a-jcombobox-with-a-divider-separator-line/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. After installing the java classes &lt;code&gt;SeparatorComboBoxRenderer&lt;/code&gt; and &lt;code&gt;SeparatorComboBoxListener&lt;/code&gt; therein (with slight adjustments), the following modification worked:
&lt;pre lang=&quot;matlab&quot;&gt;sep_txt    = &#039;--------&#039;;
hPopup     = uicontrol(&#039;Style&#039;,&#039;popup&#039;,&#039;String&#039;,{&#039;A&#039;,&#039;B&#039;,sep_txt,&#039;C&#039;});
%
jCombobox  = findjobj(hPopup);
jSeparator = javax.swing.JSeparator();
%
jCombobox.setRenderer(SeparatorComboBoxRenderer());
jCombobox.addActionListener(SeparatorComboBoxListener(jCombobox));
%
jCombobox.insertItemAt(jSeparator,2);
jCombobox.removeItemAt(3);  % this is required to keep the indices valid&lt;/pre&gt;
A similar version with &lt;code&gt;javax.swing.JComboBox&lt;/code&gt; and &lt;b&gt;&lt;i&gt;javacomponent&lt;/i&gt;&lt;/b&gt; also worked.

In any case, I thank you for the prompt response and the recommendation to work directly with java. It gave me the motivation to dig into some java code and find the solution.

Kindest regards, Yaroslav]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489">Yaroslav</a>.</p>
<p>Hi Yair,</p>
<p>Unfortunately, <b><i>javacomponent</i></b> did not solve the problem. The culprit is actually the renderer, as suggested <a href="http://esus.com/creating-a-jcombobox-with-a-divider-separator-line/" rel="nofollow">here</a>. After installing the java classes <code>SeparatorComboBoxRenderer</code> and <code>SeparatorComboBoxListener</code> therein (with slight adjustments), the following modification worked:</p>
<pre lang="matlab">sep_txt    = '--------';
hPopup     = uicontrol('Style','popup','String',{'A','B',sep_txt,'C'});
%
jCombobox  = findjobj(hPopup);
jSeparator = javax.swing.JSeparator();
%
jCombobox.setRenderer(SeparatorComboBoxRenderer());
jCombobox.addActionListener(SeparatorComboBoxListener(jCombobox));
%
jCombobox.insertItemAt(jSeparator,2);
jCombobox.removeItemAt(3);  % this is required to keep the indices valid</pre>
<p>A similar version with <code>javax.swing.JComboBox</code> and <b><i>javacomponent</i></b> also worked.</p>
<p>In any case, I thank you for the prompt response and the recommendation to work directly with java. It gave me the motivation to dig into some java code and find the solution.</p>
<p>Kindest regards, Yaroslav</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496696</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 10 Sep 2019 10:26:39 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-496696</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489&quot;&gt;Yaroslav&lt;/a&gt;.

@Yaroslav - instead of customizing the built-in Matlab uicontrol, create a standard &lt;code&gt;javax.swing.JComboBox&lt;/code&gt; (where adding a &lt;code&gt;JSeparator&lt;/code&gt; is easy), then add it to your figure window using &lt;i&gt;&lt;b&gt;javacomponent&lt;/b&gt;&lt;/i&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489">Yaroslav</a>.</p>
<p>@Yaroslav &#8211; instead of customizing the built-in Matlab uicontrol, create a standard <code>javax.swing.JComboBox</code> (where adding a <code>JSeparator</code> is easy), then add it to your figure window using <i><b>javacomponent</b></i>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yaroslav		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-496489</link>

		<dc:creator><![CDATA[Yaroslav]]></dc:creator>
		<pubDate>Mon, 09 Sep 2019 13:45:22 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-496489</guid>

					<description><![CDATA[Hi Yair, 

Do you know how to add a separator to a pop-up control (combo box)? I tried:&lt;pre lang=&quot;matlab&quot;&gt;
hPopup     = uicontrol(&#039;Style&#039;,&#039;popup&#039;,&#039;String&#039;,{&#039;A&#039;,&#039;B&#039;,&#039;C&#039;});
jCombobox  = findjobj(hPopup);
jSeparator = javax.swing.JSeparator(javax.swing.JSeparator.HORIZONTAL);
%
jCombobox.addItem(jSeparator);
&lt;/pre&gt;But, alas, it didn&#039;t work as expected (it added &lt;code&gt;jSeparator.toString()&lt;/code&gt; instead).  Where did I go wrong?

Kindest regards, Yaroslav]]></description>
			<content:encoded><![CDATA[<p>Hi Yair, </p>
<p>Do you know how to add a separator to a pop-up control (combo box)? I tried:</p>
<pre lang="matlab">
hPopup     = uicontrol('Style','popup','String',{'A','B','C'});
jCombobox  = findjobj(hPopup);
jSeparator = javax.swing.JSeparator(javax.swing.JSeparator.HORIZONTAL);
%
jCombobox.addItem(jSeparator);
</pre>
<p>But, alas, it didn&#8217;t work as expected (it added <code>jSeparator.toString()</code> instead).  Where did I go wrong?</p>
<p>Kindest regards, Yaroslav</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Customizing the standard figure toolbar, menubar &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-139997</link>

		<dc:creator><![CDATA[Customizing the standard figure toolbar, menubar &#124; Undocumented Matlab]]></dc:creator>
		<pubDate>Wed, 09 Jan 2013 20:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-139997</guid>

					<description><![CDATA[[...] We can take this idea even further by employing HTML formatting, as I have shown in my first article of the menubar mini-series: HTML-rendered menu items [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] We can take this idea even further by employing HTML formatting, as I have shown in my first article of the menubar mini-series: HTML-rendered menu items [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Customizing menu items part 2 &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-84210</link>

		<dc:creator><![CDATA[Customizing menu items part 2 &#124; Undocumented Matlab]]></dc:creator>
		<pubDate>Wed, 02 May 2012 11:57:45 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-84210</guid>

					<description><![CDATA[[...] Last week I explained how to customize Matlab’s menu items using some undocumented tricks that do not need Java [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Last week I explained how to customize Matlab’s menu items using some undocumented tricks that do not need Java [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83679</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 28 Apr 2012 17:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-83679</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349&quot;&gt;quant&lt;/a&gt;.

@Malcolm, I believe the OP does not dispute the fact that this is the expected behavior, he/she was simply asking whether there is any way to circumvent or modify this behavior. I do not know of any, but this is not saying that there isn&#039;t any...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349">quant</a>.</p>
<p>@Malcolm, I believe the OP does not dispute the fact that this is the expected behavior, he/she was simply asking whether there is any way to circumvent or modify this behavior. I do not know of any, but this is not saying that there isn&#8217;t any&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83638</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Sat, 28 Apr 2012 12:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-83638</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349&quot;&gt;quant&lt;/a&gt;.

It is not a bug, it is expected behaviour

firstfunction accepts a copy of a MATLAB double array, modifies that copy and returns without altering anything in the MyClass instance. 

secondfunction gets a reference to a java.lang.Double array as input- so MATLAB sees the changes made to that object]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349">quant</a>.</p>
<p>It is not a bug, it is expected behaviour</p>
<p>firstfunction accepts a copy of a MATLAB double array, modifies that copy and returns without altering anything in the MyClass instance. </p>
<p>secondfunction gets a reference to a java.lang.Double array as input- so MATLAB sees the changes made to that object</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83352</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 26 Apr 2012 21:08:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-83352</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349&quot;&gt;quant&lt;/a&gt;.

no...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349">quant</a>.</p>
<p>no&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: quant		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-menu-items-part-1#comment-83349</link>

		<dc:creator><![CDATA[quant]]></dc:creator>
		<pubDate>Thu, 26 Apr 2012 20:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2897#comment-83349</guid>

					<description><![CDATA[HI Yair,
not related to this post, but was curious if you 
Have you ever worked on the solution to this : 

http://stackoverflow.com/questions/5554518/can-matlab-not-read-back-a-double-array-from-java]]></description>
			<content:encoded><![CDATA[<p>HI Yair,<br />
not related to this post, but was curious if you<br />
Have you ever worked on the solution to this : </p>
<p><a href="http://stackoverflow.com/questions/5554518/can-matlab-not-read-back-a-double-array-from-java" rel="nofollow ugc">http://stackoverflow.com/questions/5554518/can-matlab-not-read-back-a-double-array-from-java</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
