<?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: Defensive GUI Programming</title>
	<atom:link href="http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Mon, 13 Feb 2012 13:24:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31848</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 16 Nov 2010 13:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31848</guid>
		<description>Robbe-

You can simply do something like:

function button2_callback(…..)
   button1_callback( and figure out the right arguments)

--Loren</description>
		<content:encoded><![CDATA[<p>Robbe-</p>
<p>You can simply do something like:</p>
<p>function button2_callback(…..)<br />
   button1_callback( and figure out the right arguments)</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robbe</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31844</link>
		<dc:creator>Robbe</dc:creator>
		<pubDate>Mon, 15 Nov 2010 10:08:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31844</guid>
		<description>Hi Loren,

I wanted to ask you about function calling. For example I have a gui that has some buttons in m code it looks like this:

function button_callback(.....)
some comands
function button1_callback(.....)
some comands
function button2_callback(.....)

What should I write below the button2 callback, that would execute button one commands. In other words by pressing button2, button commands would execute. Some sort of jump to command or run. Any thoughts on this?</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>I wanted to ask you about function calling. For example I have a gui that has some buttons in m code it looks like this:</p>
<p>function button_callback(&#8230;..)<br />
some comands<br />
function button1_callback(&#8230;..)<br />
some comands<br />
function button2_callback(&#8230;..)</p>
<p>What should I write below the button2 callback, that would execute button one commands. In other words by pressing button2, button commands would execute. Some sort of jump to command or run. Any thoughts on this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31138</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 08 Mar 2010 19:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31138</guid>
		<description>Thomas-

You might be better off writing the GUI using nested functions.  Then there would be exactly one truth for your guidata and it couldn&#039;t get out of sync.  I recommend reading &lt;a href=&quot;http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; and examining the code to see how the works.  It&#039;s better, in my opinion, than global variables because I can have multiple versions of the GUI without them messing each other up.  While the data is available where it needs to be, unlike global, it is not available everywhere.

--Loren</description>
		<content:encoded><![CDATA[<p>Thomas-</p>
<p>You might be better off writing the GUI using nested functions.  Then there would be exactly one truth for your guidata and it couldn&#8217;t get out of sync.  I recommend reading <a href="http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/" rel="nofollow">this post</a> and examining the code to see how the works.  It&#8217;s better, in my opinion, than global variables because I can have multiple versions of the GUI without them messing each other up.  While the data is available where it needs to be, unlike global, it is not available everywhere.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Strehl</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31137</link>
		<dc:creator>Thomas Strehl</dc:creator>
		<pubDate>Mon, 08 Mar 2010 19:12:58 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31137</guid>
		<description>Hi Loren !

I&#039;m writing a GUI that uses the Image Acquistion Toolbox.
Real time video processing is done in the &#039;FramesAcquiredFunction&#039; video callback. On top of that there may be asyncron callbacks from the GUI.

I put all my application data in a structure, and all callbacks/functions shall read/write this structure.

Currently the structure is tied to the gui/callbacks via guidata(). This has the drawback that i sometimes overwrite my data when another async callback is invoked, even though i call guidata() rather often. Also, the structure contains a lot of data, and a lot of copies of these are beeing created for callbacks, function calls and calls to guidata().

Is there a more safe / less resource consuming option ?
Would it be better to resort to a global ?
Any possibility to have just one copy of the structure in memory and create a handle to it ?

Thanks
Thomas</description>
		<content:encoded><![CDATA[<p>Hi Loren !</p>
<p>I&#8217;m writing a GUI that uses the Image Acquistion Toolbox.<br />
Real time video processing is done in the &#8216;FramesAcquiredFunction&#8217; video callback. On top of that there may be asyncron callbacks from the GUI.</p>
<p>I put all my application data in a structure, and all callbacks/functions shall read/write this structure.</p>
<p>Currently the structure is tied to the gui/callbacks via guidata(). This has the drawback that i sometimes overwrite my data when another async callback is invoked, even though i call guidata() rather often. Also, the structure contains a lot of data, and a lot of copies of these are beeing created for callbacks, function calls and calls to guidata().</p>
<p>Is there a more safe / less resource consuming option ?<br />
Would it be better to resort to a global ?<br />
Any possibility to have just one copy of the structure in memory and create a handle to it ?</p>
<p>Thanks<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31092</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 18 Feb 2010 12:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31092</guid>
		<description>Lauren, 

I don&#039;t know a good short way but maybe someone else will. 

--Loren</description>
		<content:encoded><![CDATA[<p>Lauren, </p>
<p>I don&#8217;t know a good short way but maybe someone else will. </p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lauren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31090</link>
		<dc:creator>Lauren</dc:creator>
		<pubDate>Thu, 18 Feb 2010 00:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-31090</guid>
		<description>Hi Loren,

I have a gui with a callback that plots data in several axes.  At times, it takes a while for the plotting to complete, and I would like to be able to cancel plotting when I initiate another callback rather than just interrupt it and have it finish later.  I don&#039;t see a good way to do this using just the busyaction and interruptible properties.  Is there a straightforward way to cancel something that is in progress rather than just interrupt it?

cheers,
Lauren</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>I have a gui with a callback that plots data in several axes.  At times, it takes a while for the plotting to complete, and I would like to be able to cancel plotting when I initiate another callback rather than just interrupt it and have it finish later.  I don&#8217;t see a good way to do this using just the busyaction and interruptible properties.  Is there a straightforward way to cancel something that is in progress rather than just interrupt it?</p>
<p>cheers,<br />
Lauren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26666</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 25 Feb 2008 15:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26666</guid>
		<description>Jegan-

This problem is too complex to do in this forum, especially without code.  Please contact technical support for help here and be sure to have your code ready to send them.

--Loren</description>
		<content:encoded><![CDATA[<p>Jegan-</p>
<p>This problem is too complex to do in this forum, especially without code.  Please contact technical support for help here and be sure to have your code ready to send them.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jegan</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26665</link>
		<dc:creator>Jegan</dc:creator>
		<pubDate>Mon, 25 Feb 2008 15:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26665</guid>
		<description>Hello Loren,

Recently I had created a GUI which uses a JAVA object (JPanel) to create a custom table,during the process I found that the sequence of execution is not what was expected.The callbacks associated to the Java Objects were fired after the completion of the Matlab calls. The problem became more complex when I had called a seperate Matlab GUI and then set the focus back on the GUI with the Java Object,this time the sequence of execution was the same as expected.
I feel that the Stack order could be a possible reason.
Kindly help me understand.</description>
		<content:encoded><![CDATA[<p>Hello Loren,</p>
<p>Recently I had created a GUI which uses a JAVA object (JPanel) to create a custom table,during the process I found that the sequence of execution is not what was expected.The callbacks associated to the Java Objects were fired after the completion of the Matlab calls. The problem became more complex when I had called a seperate Matlab GUI and then set the focus back on the GUI with the Java Object,this time the sequence of execution was the same as expected.<br />
I feel that the Stack order could be a possible reason.<br />
Kindly help me understand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve L</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26527</link>
		<dc:creator>Steve L</dc:creator>
		<pubDate>Thu, 21 Feb 2008 00:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26527</guid>
		<description>Another possibility is to have the GUI create a UICONTROL, UIPUSHTOOL, or UITOGGLETOOL on the figures it creates and have that object use GCBF to adjust the hold state for the figure in which it&#039;s located.  Alternately, UIMENU or UICONTEXTMENU could also do the trick.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uipushtool.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uitoggletool.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uimenu.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontextmenu.html</description>
		<content:encoded><![CDATA[<p>Another possibility is to have the GUI create a UICONTROL, UIPUSHTOOL, or UITOGGLETOOL on the figures it creates and have that object use GCBF to adjust the hold state for the figure in which it&#8217;s located.  Alternately, UIMENU or UICONTEXTMENU could also do the trick.</p>
<p><a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol.html</a><br />
<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uipushtool.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uipushtool.html</a><br />
<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uitoggletool.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uitoggletool.html</a><br />
<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uimenu.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uimenu.html</a><br />
<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontextmenu.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontextmenu.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendon</title>
		<link>http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26512</link>
		<dc:creator>Brendon</dc:creator>
		<pubDate>Wed, 20 Feb 2008 18:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/11/07/defensive-gui-programming/#comment-26512</guid>
		<description>Thanks, that helps. I read your article and I understand why it&#039;s risky but it&#039;s an engineering tool only and thus doesn&#039;t need to be invulnerable to impatience. People are expected to know what&#039;s up.</description>
		<content:encoded><![CDATA[<p>Thanks, that helps. I read your article and I understand why it&#8217;s risky but it&#8217;s an engineering tool only and thus doesn&#8217;t need to be invulnerable to impatience. People are expected to know what&#8217;s up.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

