<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599</link>
    <title>MATLAB Central Newsreader - Programmatic GUI pushbutton callback</title>
    <description>Feed for thread: Programmatic GUI pushbutton callback</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 26 Jun 2008 15:55:03 -0400</pubDate>
      <title>Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439652</link>
      <author>Kris Ezra</author>
      <description>&lt;br&gt;
I am building a GUI to interface with a MATLAB model and, &lt;br&gt;
in the interest of maintaining GUI variables in the &lt;br&gt;
workspace and accessible, I have opted to create it &lt;br&gt;
programmatically and not in function form instead of with &lt;br&gt;
GUIDE.&lt;br&gt;
&lt;br&gt;
The problem I have is that, while I can easily create the &lt;br&gt;
GUI and push buttons with code like&lt;br&gt;
&lt;br&gt;
startbutton = &lt;br&gt;
uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
Scenario',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
[0.8,0.8,0.8]);  &lt;br&gt;
&lt;br&gt;
I cannot find any way to set the button callback.  I would &lt;br&gt;
rather not use custom functions (which shouldnt matter &lt;br&gt;
since the main GUI is just written in a script file) and I &lt;br&gt;
cant find a solution.&lt;br&gt;
&lt;br&gt;
As a simple test, I would like to have &quot;startbutton&quot; open a &lt;br&gt;
PDF file.&lt;br&gt;
&lt;br&gt;
I have tried something to the effect of set&lt;br&gt;
(startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
does not work.  What else can I do to code button callbacks?</description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 16:10:22 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439655</link>
      <author>matt dash</author>
      <description>&quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g40e4n$aiq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am building a GUI to interface with a MATLAB model and, &lt;br&gt;
&amp;gt; in the interest of maintaining GUI variables in the &lt;br&gt;
&amp;gt; workspace and accessible, I have opted to create it &lt;br&gt;
&amp;gt; programmatically and not in function form instead of with &lt;br&gt;
&amp;gt; GUIDE.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The problem I have is that, while I can easily create the &lt;br&gt;
&amp;gt; GUI and push buttons with code like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; startbutton = &lt;br&gt;
&amp;gt; uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;gt; Scenario',...&lt;br&gt;
&amp;gt;     'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;gt; [0.8,0.8,0.8]);  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I cannot find any way to set the button callback.  I would &lt;br&gt;
&amp;gt; rather not use custom functions (which shouldnt matter &lt;br&gt;
&amp;gt; since the main GUI is just written in a script file) and I &lt;br&gt;
&amp;gt; cant find a solution.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a simple test, I would like to have &quot;startbutton&quot; open a &lt;br&gt;
&amp;gt; PDF file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have tried something to the effect of set&lt;br&gt;
&amp;gt; (startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
&amp;gt; does not work.  What else can I do to code button callbacks?&lt;br&gt;
&lt;br&gt;
try putting the callback in single quotes to make it a string...</description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 16:15:04 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439658</link>
      <author>matt dash</author>
      <description>&quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g40e4n$aiq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am building a GUI to interface with a MATLAB model and, &lt;br&gt;
&amp;gt; in the interest of maintaining GUI variables in the &lt;br&gt;
&amp;gt; workspace and accessible, I have opted to create it &lt;br&gt;
&amp;gt; programmatically and not in function form instead of with &lt;br&gt;
&amp;gt; GUIDE.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The problem I have is that, while I can easily create the &lt;br&gt;
&amp;gt; GUI and push buttons with code like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; startbutton = &lt;br&gt;
&amp;gt; uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;gt; Scenario',...&lt;br&gt;
&amp;gt;     'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;gt; [0.8,0.8,0.8]);  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I cannot find any way to set the button callback.  I would &lt;br&gt;
&amp;gt; rather not use custom functions (which shouldnt matter &lt;br&gt;
&amp;gt; since the main GUI is just written in a script file) and I &lt;br&gt;
&amp;gt; cant find a solution.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a simple test, I would like to have &quot;startbutton&quot; open a &lt;br&gt;
&amp;gt; PDF file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have tried something to the effect of set&lt;br&gt;
&amp;gt; (startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
&amp;gt; does not work.  What else can I do to code button callbacks?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I should be more specific:&lt;br&gt;
&lt;br&gt;
The &quot;best&quot; thing to do is this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;nbsp;Scenario',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;nbsp;[0.8,0.8,0.8],...&lt;br&gt;
'callback',@button1_callback); &lt;br&gt;
&lt;br&gt;
and at the end of your file:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
function button1_callback(src,eventdata)&lt;br&gt;
hanldles=guidata(src)&lt;br&gt;
&lt;br&gt;
open usersguide.pdf&lt;br&gt;
&lt;br&gt;
guidata(src,handles)</description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 17:28:02 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439691</link>
      <author>Kris Ezra</author>
      <description>&quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g40e4n$aiq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am building a GUI to interface with a MATLAB model and, &lt;br&gt;
&amp;gt; in the interest of maintaining GUI variables in the &lt;br&gt;
&amp;gt; workspace and accessible, I have opted to create it &lt;br&gt;
&amp;gt; programmatically and not in function form instead of with &lt;br&gt;
&amp;gt; GUIDE.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The problem I have is that, while I can easily create the &lt;br&gt;
&amp;gt; GUI and push buttons with code like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; startbutton = &lt;br&gt;
&amp;gt; uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;gt; Scenario',...&lt;br&gt;
&amp;gt;     'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;gt; [0.8,0.8,0.8]);  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I cannot find any way to set the button callback.  I &lt;br&gt;
would &lt;br&gt;
&amp;gt; rather not use custom functions (which shouldnt matter &lt;br&gt;
&amp;gt; since the main GUI is just written in a script file) and &lt;br&gt;
I &lt;br&gt;
&amp;gt; cant find a solution.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a simple test, I would like to have &quot;startbutton&quot; open &lt;br&gt;
a &lt;br&gt;
&amp;gt; PDF file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have tried something to the effect of set&lt;br&gt;
&amp;gt; (startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
&amp;gt; does not work.  What else can I do to code button &lt;br&gt;
callbacks?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The idea of keeping the callback in single quotes &lt;br&gt;
definitely worked for this specific example; however, &lt;br&gt;
because I'm writing the gui in a script file I cannot &lt;br&gt;
define functions at the end so the second idea is out.  Is &lt;br&gt;
there another option besides creating custom external &lt;br&gt;
functions for EVERY uicontrol item I write (besides some &lt;br&gt;
complicated flagging system that I could write to do the &lt;br&gt;
functionality?&lt;br&gt;
&lt;br&gt;
I would like to find a way to do callbacks contained in the &lt;br&gt;
script file that conduct lengthy operations.  For example, &lt;br&gt;
I may have a next button that calls a giant switch to see &lt;br&gt;
what panels to set as visible or invisible wich I would &lt;br&gt;
rather not have to put in single quotes inside the button &lt;br&gt;
definition :).&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
Kris </description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 17:46:02 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439701</link>
      <author>matt dash</author>
      <description>&quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g40jj2$f7m$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;g40e4n$aiq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I am building a GUI to interface with a MATLAB model and, &lt;br&gt;
&amp;gt; &amp;gt; in the interest of maintaining GUI variables in the &lt;br&gt;
&amp;gt; &amp;gt; workspace and accessible, I have opted to create it &lt;br&gt;
&amp;gt; &amp;gt; programmatically and not in function form instead of with &lt;br&gt;
&amp;gt; &amp;gt; GUIDE.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The problem I have is that, while I can easily create the &lt;br&gt;
&amp;gt; &amp;gt; GUI and push buttons with code like&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; startbutton = &lt;br&gt;
&amp;gt; &amp;gt; uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;gt; &amp;gt; Scenario',...&lt;br&gt;
&amp;gt; &amp;gt;     'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;gt; &amp;gt; [0.8,0.8,0.8]);  &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I cannot find any way to set the button callback.  I &lt;br&gt;
&amp;gt; would &lt;br&gt;
&amp;gt; &amp;gt; rather not use custom functions (which shouldnt matter &lt;br&gt;
&amp;gt; &amp;gt; since the main GUI is just written in a script file) and &lt;br&gt;
&amp;gt; I &lt;br&gt;
&amp;gt; &amp;gt; cant find a solution.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; As a simple test, I would like to have &quot;startbutton&quot; open &lt;br&gt;
&amp;gt; a &lt;br&gt;
&amp;gt; &amp;gt; PDF file.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have tried something to the effect of set&lt;br&gt;
&amp;gt; &amp;gt; (startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
&amp;gt; &amp;gt; does not work.  What else can I do to code button &lt;br&gt;
&amp;gt; callbacks?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The idea of keeping the callback in single quotes &lt;br&gt;
&amp;gt; definitely worked for this specific example; however, &lt;br&gt;
&amp;gt; because I'm writing the gui in a script file I cannot &lt;br&gt;
&amp;gt; define functions at the end so the second idea is out.  Is &lt;br&gt;
&amp;gt; there another option besides creating custom external &lt;br&gt;
&amp;gt; functions for EVERY uicontrol item I write (besides some &lt;br&gt;
&amp;gt; complicated flagging system that I could write to do the &lt;br&gt;
&amp;gt; functionality?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to find a way to do callbacks contained in the &lt;br&gt;
&amp;gt; script file that conduct lengthy operations.  For example, &lt;br&gt;
&amp;gt; I may have a next button that calls a giant switch to see &lt;br&gt;
&amp;gt; what panels to set as visible or invisible wich I would &lt;br&gt;
&amp;gt; rather not have to put in single quotes inside the button &lt;br&gt;
&amp;gt; definition :).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kris &lt;br&gt;
&lt;br&gt;
Well I don't know about that, but is there any reason you&lt;br&gt;
can't turn your script file into a function file just by&lt;br&gt;
putting the line:&lt;br&gt;
&lt;br&gt;
function myguiname&lt;br&gt;
&lt;br&gt;
at the top? That would let you define more functions in the&lt;br&gt;
file at the end. I do this all the time. But even with the&lt;br&gt;
script I think you should be able to do what I said and just&lt;br&gt;
put the callbacks in functions in their own, separate files. </description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 18:15:03 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439716</link>
      <author>Yuri Geshelin</author>
      <description>&quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g40jj2$f7m$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Kris Ezra&quot; &amp;lt;sharpshooter1405@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;g40e4n$aiq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I am building a GUI to interface with a MATLAB model &lt;br&gt;
and, &lt;br&gt;
&amp;gt; &amp;gt; in the interest of maintaining GUI variables in the &lt;br&gt;
&amp;gt; &amp;gt; workspace and accessible, I have opted to create it &lt;br&gt;
&amp;gt; &amp;gt; programmatically and not in function form instead of &lt;br&gt;
with &lt;br&gt;
&amp;gt; &amp;gt; GUIDE.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The problem I have is that, while I can easily create &lt;br&gt;
the &lt;br&gt;
&amp;gt; &amp;gt; GUI and push buttons with code like&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; startbutton = &lt;br&gt;
&amp;gt; &amp;gt; uicontrol(panel3,'Style','pushbutton','String','Create &lt;br&gt;
&amp;gt; &amp;gt; Scenario',...&lt;br&gt;
&amp;gt; &amp;gt;     'Position',[40, 80, 120, 40], 'BackgroundColor', &lt;br&gt;
&amp;gt; &amp;gt; [0.8,0.8,0.8]);  &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I cannot find any way to set the button callback.  I &lt;br&gt;
&amp;gt; would &lt;br&gt;
&amp;gt; &amp;gt; rather not use custom functions (which shouldnt matter &lt;br&gt;
&amp;gt; &amp;gt; since the main GUI is just written in a script file) &lt;br&gt;
and &lt;br&gt;
&amp;gt; I &lt;br&gt;
&amp;gt; &amp;gt; cant find a solution.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; As a simple test, I would like to have &quot;startbutton&quot; &lt;br&gt;
open &lt;br&gt;
&amp;gt; a &lt;br&gt;
&amp;gt; &amp;gt; PDF file.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have tried something to the effect of set&lt;br&gt;
&amp;gt; &amp;gt; (startbutton, 'Callback', open usersguide.pdf) but this &lt;br&gt;
&amp;gt; &amp;gt; does not work.  What else can I do to code button &lt;br&gt;
&amp;gt; callbacks?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The idea of keeping the callback in single quotes &lt;br&gt;
&amp;gt; definitely worked for this specific example; however, &lt;br&gt;
&amp;gt; because I'm writing the gui in a script file I cannot &lt;br&gt;
&amp;gt; define functions at the end so the second idea is out.  &lt;br&gt;
Is &lt;br&gt;
&amp;gt; there another option besides creating custom external &lt;br&gt;
&amp;gt; functions for EVERY uicontrol item I write (besides some &lt;br&gt;
&amp;gt; complicated flagging system that I could write to do the &lt;br&gt;
&amp;gt; functionality?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to find a way to do callbacks contained in &lt;br&gt;
the &lt;br&gt;
&amp;gt; script file that conduct lengthy operations.  For &lt;br&gt;
example, &lt;br&gt;
&amp;gt; I may have a next button that calls a giant switch to see &lt;br&gt;
&amp;gt; what panels to set as visible or invisible wich I would &lt;br&gt;
&amp;gt; rather not have to put in single quotes inside the button &lt;br&gt;
&amp;gt; definition :).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kris &lt;br&gt;
&lt;br&gt;
Kris,&lt;br&gt;
&lt;br&gt;
First, I totally agree with matt dash's last post, in fact, &lt;br&gt;
I was typing up the same concepts, but he came ahead of me.&lt;br&gt;
Second, you do not like the idea of having a function per &lt;br&gt;
button. Fair enough. Here is what you can do.&lt;br&gt;
&lt;br&gt;
Suppose you have 4 buttons, whose handles make up an array h&lt;br&gt;
(1:4)&lt;br&gt;
&lt;br&gt;
for i = 1 : 4&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;set(h(i),'callback',{@my_funct,i})&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
The header of my_funct (whether nested or separate) will &lt;br&gt;
then be:&lt;br&gt;
&lt;br&gt;
function my_funct(src,eventdata,button_number)&lt;br&gt;
&lt;br&gt;
And then it's up to you to write &quot;switch button_number&quot; and &lt;br&gt;
do what you like.&lt;br&gt;
&lt;br&gt;
Alternatively, callback can be implemented in this way:&lt;br&gt;
&lt;br&gt;
set(h(i),'callback',['my_funct(' num2str(i) ')'])&lt;br&gt;
&lt;br&gt;
In this case, you need only one argument in my_funct: &lt;br&gt;
button_number. But in a more complicate case better use &lt;br&gt;
function handles.&lt;br&gt;
&lt;br&gt;
Yuri&lt;br&gt;
&lt;br&gt;
PS I did not test these particular commands, but the &lt;br&gt;
approach used to work out for me many times.</description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 18:43:06 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439728</link>
      <author>Kris Ezra</author>
      <description>&lt;br&gt;
Thanks!  Between the two of you I think I have it figured &lt;br&gt;
out.  The issue is that by turning the gui script into a &lt;br&gt;
function, I have scope problems interfacing with the model &lt;br&gt;
script it has to interface with.  After talking with my &lt;br&gt;
colleagues on the project we will just use multiple custom &lt;br&gt;
functions for callbacks.&lt;br&gt;
&lt;br&gt;
As a last question, is there any reason why I should be &lt;br&gt;
including the guidata(src,handles) style internal saves in &lt;br&gt;
these functions?  I deleted this and the &quot;handles = get&lt;br&gt;
(whatever) from the first code and it still works it &lt;br&gt;
appears.  I understand that when you are using GUIDE this &lt;br&gt;
updates the handles structure so if you are carrying &lt;br&gt;
variables they actually get changed, but if I'm just &lt;br&gt;
setting properties (i.e., visibility on and off) is this &lt;br&gt;
useful/necessary? </description>
    </item>
    <item>
      <pubDate>Thu, 26 Jun 2008 19:02:01 -0400</pubDate>
      <title>Re: Programmatic GUI pushbutton callback</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171599#439740</link>
      <author>matt dash</author>
      <description>&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a last question, is there any reason why I should be &lt;br&gt;
&amp;gt; including the guidata(src,handles) style internal saves in &lt;br&gt;
&amp;gt; these functions?  I deleted this and the &quot;handles = get&lt;br&gt;
&amp;gt; (whatever) from the first code and it still works it &lt;br&gt;
&amp;gt; appears.  I understand that when you are using GUIDE this &lt;br&gt;
&amp;gt; updates the handles structure so if you are carrying &lt;br&gt;
&amp;gt; variables they actually get changed, but if I'm just &lt;br&gt;
&amp;gt; setting properties (i.e., visibility on and off) is this &lt;br&gt;
&amp;gt; useful/necessary? &lt;br&gt;
&lt;br&gt;
No, you only need to load &quot;handles&quot; at the start of&lt;br&gt;
functions that will need to reference it, and save &quot;handles&quot;&lt;br&gt;
at the end of functions that change it. So if a callback&lt;br&gt;
sets properties of objects whose handles are stored in&lt;br&gt;
&quot;handles&quot;, you will need to load it to reference them, but&lt;br&gt;
you won't need to save it. I put those in the example&lt;br&gt;
because (if you are using handles at all) it never hurts to&lt;br&gt;
have them there.</description>
    </item>
  </channel>
</rss>

