<?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: uisplittool &#038; uitogglesplittool	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=uisplittool-uitogglesplittool</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 19 Mar 2024 09:30:55 +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/uisplittool-uitogglesplittool#comment-523826</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 19 Mar 2024 09:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-523826</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-523824&quot;&gt;Matlab-user&lt;/a&gt;.

which Matlab version are you using?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-523824">Matlab-user</a>.</p>
<p>which Matlab version are you using?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matlab-user		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-523824</link>

		<dc:creator><![CDATA[Matlab-user]]></dc:creator>
		<pubDate>Tue, 19 Mar 2024 09:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-523824</guid>

					<description><![CDATA[I am trying to do it using uipushtool since uisplittool is not supported anymore. I am able to insert the image icon in the toolbar, but not sure how to get the dropdown (trying to make it backward compatible to uisplittool). Here is the code:
&lt;pre lang=&quot;matlab&quot;&gt;
defaultToolbar = findall(gcf,&#039;Type&#039;,&#039;uitoolbar&#039;);
pt = uipushtool(defaultToolbar);
[img,map] = imread(fullfile(matlabroot,...
            &#039;toolbox&#039;,&#039;matlab&#039;,&#039;icons&#039;,&#039;matlabicon.gif&#039;));
ptImage = ind2rgb(img,map);
pt.CData = ptImage;
&lt;/pre&gt;
Can someone help me making it function like uisplittool? I have the code written which is dependent on uisplittool, so need to make the new functionality backward compatible to it.

Thanks in advance.]]></description>
			<content:encoded><![CDATA[<p>I am trying to do it using uipushtool since uisplittool is not supported anymore. I am able to insert the image icon in the toolbar, but not sure how to get the dropdown (trying to make it backward compatible to uisplittool). Here is the code:</p>
<pre lang="matlab">
defaultToolbar = findall(gcf,'Type','uitoolbar');
pt = uipushtool(defaultToolbar);
[img,map] = imread(fullfile(matlabroot,...
            'toolbox','matlab','icons','matlabicon.gif'));
ptImage = ind2rgb(img,map);
pt.CData = ptImage;
</pre>
<p>Can someone help me making it function like uisplittool? I have the code written which is dependent on uisplittool, so need to make the new functionality backward compatible to it.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kees de Kapper		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-404499</link>

		<dc:creator><![CDATA[Kees de Kapper]]></dc:creator>
		<pubDate>Fri, 07 Apr 2017 07:12:15 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-404499</guid>

					<description><![CDATA[Dear Yair,

Thank you for your extensive descriptions. 
However, I was wondering if it is possible to add icons to the jMenuItem in the uitogglesplittool or uisplittool? 
And secondly, is there a straight forward method to obtain the index of the selected jMenuItem.

Many thanks for your consideration.
All the Best,
Kees]]></description>
			<content:encoded><![CDATA[<p>Dear Yair,</p>
<p>Thank you for your extensive descriptions.<br />
However, I was wondering if it is possible to add icons to the jMenuItem in the uitogglesplittool or uisplittool?<br />
And secondly, is there a straight forward method to obtain the index of the selected jMenuItem.</p>
<p>Many thanks for your consideration.<br />
All the Best,<br />
Kees</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390133</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 06 Oct 2016 20:34:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-390133</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390132&quot;&gt;Christina&lt;/a&gt;.

Sounds like an &lt;a href=&quot;http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt&quot; rel=&quot;nofollow&quot;&gt;EDT issue&lt;/a&gt;. Try adding &lt;i&gt;&lt;b&gt;drawnow&lt;/b&gt;&lt;/i&gt; and/or &lt;i&gt;&lt;b&gt;pause&lt;/b&gt;(0.1)&lt;/i&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390132">Christina</a>.</p>
<p>Sounds like an <a href="http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt" rel="nofollow">EDT issue</a>. Try adding <i><b>drawnow</b></i> and/or <i><b>pause</b>(0.1)</i>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Christina		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390132</link>

		<dc:creator><![CDATA[Christina]]></dc:creator>
		<pubDate>Thu, 06 Oct 2016 20:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-390132</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390129&quot;&gt;Christina&lt;/a&gt;.

I forgot to mention that if I go into debug mode and step through each line of code, then it works perfectly.  When I let it run on its own is when it crashes.  Not sure if that makes a difference.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390129">Christina</a>.</p>
<p>I forgot to mention that if I go into debug mode and step through each line of code, then it works perfectly.  When I let it run on its own is when it crashes.  Not sure if that makes a difference.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Christina		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-390129</link>

		<dc:creator><![CDATA[Christina]]></dc:creator>
		<pubDate>Thu, 06 Oct 2016 19:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-390129</guid>

					<description><![CDATA[I&#039;m using this capability with 2013a but am having a problem with it crashing.  I tried putting my code in the GUIDE OpeningFcn as well as the OutputFcn but get the same results.  My code is as follows:

&lt;pre lang=&quot;matlab&quot;&gt;
color = java.awt.Color(0,0,0);

% hToolbar = findall(gcf,&#039;tag&#039;,&#039;hToolbar&#039;);
jToolbar = get(get(handles.hToolbar,&#039;JavaContainer&#039;),&#039;ComponentPeer&#039;);

% Create a splittool for different options
hLayout = uisplittool(&#039;parent&#039;,handles.hToolbar);       % uisplittool

% Load the icon
icon = fullfile(pwd,&#039;icons&#039;,&#039;Icon.gif&#039;);
[cdata,map] = imread(icon);
map(find(map(:,1)+map(:,2)+map(:,3)==3)) = NaN;
  
set(hLayout, &#039;tag&#039;,&#039;testingButton&#039;,&#039;cdata&#039;,ind2rgb(cdata,map), &#039;tooltip&#039;,&#039;Layout Types&#039;,&#039;Separator&#039;,&#039;on&#039;, ...
           &#039;ClickedCallback&#039;,[]);

jLayout = get(hLayout,&#039;JavaContainer&#039;);
jLayoutMenu = jLayout.getMenuComponent;
imageToolkit = java.awt.Toolkit.getDefaultToolkit;
for layoutInd = 1:3
    jMenuItem = handle(jLayoutMenu.add([&#039;Layout &#039; num2str(layoutInd)]),&#039;CallbackProperties&#039;);
    set(jMenuItem,&#039;ActionPerformedCallback&#039;,{@changeLayout,layoutInd});
    myIcon = fullfile(pwd,&#039;icons&#039;,[&#039;layout&#039; num2str(layoutInd) &#039;.gif&#039;]);
    jMenuItem.setIcon(javax.swing.ImageIcon(imageToolkit.createImage(myIcon)));
    jMenuItem.setBackground(color);
end

jToolbar.revalidate;
&lt;/pre&gt;

I think I&#039;ve narrowed it down that the following line of code is what is causing it to crash:
&lt;pre lang=&quot;matlab&quot;&gt;
jLayout = get(hLayout,&#039;JavaContainer&#039;);
&lt;/pre&gt;

Any suggestions on how to remedy this??

Thanks!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using this capability with 2013a but am having a problem with it crashing.  I tried putting my code in the GUIDE OpeningFcn as well as the OutputFcn but get the same results.  My code is as follows:</p>
<pre lang="matlab">
color = java.awt.Color(0,0,0);

% hToolbar = findall(gcf,'tag','hToolbar');
jToolbar = get(get(handles.hToolbar,'JavaContainer'),'ComponentPeer');

% Create a splittool for different options
hLayout = uisplittool('parent',handles.hToolbar);       % uisplittool

% Load the icon
icon = fullfile(pwd,'icons','Icon.gif');
[cdata,map] = imread(icon);
map(find(map(:,1)+map(:,2)+map(:,3)==3)) = NaN;
  
set(hLayout, 'tag','testingButton','cdata',ind2rgb(cdata,map), 'tooltip','Layout Types','Separator','on', ...
           'ClickedCallback',[]);

jLayout = get(hLayout,'JavaContainer');
jLayoutMenu = jLayout.getMenuComponent;
imageToolkit = java.awt.Toolkit.getDefaultToolkit;
for layoutInd = 1:3
    jMenuItem = handle(jLayoutMenu.add(['Layout ' num2str(layoutInd)]),'CallbackProperties');
    set(jMenuItem,'ActionPerformedCallback',{@changeLayout,layoutInd});
    myIcon = fullfile(pwd,'icons',['layout' num2str(layoutInd) '.gif']);
    jMenuItem.setIcon(javax.swing.ImageIcon(imageToolkit.createImage(myIcon)));
    jMenuItem.setBackground(color);
end

jToolbar.revalidate;
</pre>
<p>I think I&#8217;ve narrowed it down that the following line of code is what is causing it to crash:</p>
<pre lang="matlab">
jLayout = get(hLayout,'JavaContainer');
</pre>
<p>Any suggestions on how to remedy this??</p>
<p>Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Customizing the standard figure toolbar, menubar &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-140001</link>

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

					<description><![CDATA[[...] The idea here is to replace the standard toolbar &quot;Open File&quot; pushbutton with a new uisplittool button that will contain the MRU list in its picker-menu. [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] The idea here is to replace the standard toolbar &#8220;Open File&#8221; pushbutton with a new uisplittool button that will contain the MRU list in its picker-menu. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-54896</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 24 Aug 2011 20:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-54896</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-54832&quot;&gt;cK&lt;/a&gt;.

@cK - Transparency only works in GUI controls. It is unfortunately not supported by Matlab&#039;s &lt;i&gt;&lt;b&gt;image&lt;/b&gt;&lt;/i&gt; function that displays the image in Matlab plot axes.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-54832">cK</a>.</p>
<p>@cK &#8211; Transparency only works in GUI controls. It is unfortunately not supported by Matlab&#8217;s <i><b>image</b></i> function that displays the image in Matlab plot axes.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cK		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-54832</link>

		<dc:creator><![CDATA[cK]]></dc:creator>
		<pubDate>Wed, 24 Aug 2011 02:55:06 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-54832</guid>

					<description><![CDATA[I was curious to know if there is a way to retain transparency of png images or even convert white pixels of a logo image into transparent background (it looks sweet on GUIs). I tried the following on a gif image and the image still gave a white background. Why doesnt it work?
&lt;pre lang=&#039;matlab&#039;&gt;
[cdata,map] = imread(&#039;logo.gif&#039;);
map(find(map(:,1)+map(:,2)+map(:,3)==3)) = NaN;
% Convert into 3D RGB-space
cdata2 = ind2rgb(cdata,map);
image(cdata2);
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>I was curious to know if there is a way to retain transparency of png images or even convert white pixels of a logo image into transparent background (it looks sweet on GUIs). I tried the following on a gif image and the image still gave a white background. Why doesnt it work?</p>
<pre lang='matlab'>
[cdata,map] = imread('logo.gif');
map(find(map(:,1)+map(:,2)+map(:,3)==3)) = NaN;
% Convert into 3D RGB-space
cdata2 = ind2rgb(cdata,map);
image(cdata2);
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dan		</title>
		<link>https://undocumentedmatlab.com/articles/uisplittool-uitogglesplittool#comment-25802</link>

		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Tue, 14 Dec 2010 20:57:17 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1994#comment-25802</guid>

					<description><![CDATA[out of topic, but thank you for your efforts.

You are of great help to many Matlab practitioners!

Best regards

Dan]]></description>
			<content:encoded><![CDATA[<p>out of topic, but thank you for your efforts.</p>
<p>You are of great help to many Matlab practitioners!</p>
<p>Best regards</p>
<p>Dan</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
