<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155215</link>
    <title>MATLAB Central Newsreader - GUI question - don't want rmappdata called, but don't want to use uiwait</title>
    <description>Feed for thread: GUI question - don't want rmappdata called, but don't want to use uiwait</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2010 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 27 Aug 2007 18:00:46 -0400</pubDate>
      <title>GUI question - don't want rmappdata called, but don't want to use uiwait</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155215#389570</link>
      <author>G.A.M. </author>
      <description>I am writing an application with multiple windows. I want&lt;br&gt;
the main window to open first. Then I want the user to be&lt;br&gt;
able to interact with this main window (via uicontrols). I&lt;br&gt;
want plots to be drawn in this main window, etc. Sometimes&lt;br&gt;
dialogs and other windows will be opened, but the main&lt;br&gt;
window should always remain open. I think this is the&lt;br&gt;
default behavior...&lt;br&gt;
&lt;br&gt;
When I try to run my program, the figure's OpeningFcn is&lt;br&gt;
called, initialize_gui is called, the main gui window is&lt;br&gt;
created and displayed and my uicontrols work. But, rmappdata&lt;br&gt;
in gui_mainfcn is immediately called and the handle to my&lt;br&gt;
main window is removed at that point. When my m-files call&lt;br&gt;
findobj('Tag', 'tag_my_main_window') the resulting handle is&lt;br&gt;
empty. When I execute h = findobj in the workspace, my main&lt;br&gt;
window and all its controls are not among the handles returned. &lt;br&gt;
&lt;br&gt;
My code fails because it cannot obtain a handle to my main&lt;br&gt;
window for plotting or anything else.&lt;br&gt;
&lt;br&gt;
Does anyone have an idea where I'm going wrong? This is in&lt;br&gt;
r2007a.&lt;br&gt;
&lt;br&gt;
Thank you&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 27 Aug 2007 18:42:03 -0400</pubDate>
      <title>Re: GUI question - don't want rmappdata called, but don't want to use uiwait</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155215#389572</link>
      <author>Darik </author>
      <description>I would guess that the figure's HandleVisibility is set to&lt;br&gt;
'Callback' - as a quick solution you could simply set it to&lt;br&gt;
'on' so callback functions for other figures are able to see it.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 27 Aug 2007 19:22:20 -0400</pubDate>
      <title>Re: GUI question - don't want rmappdata called, but don't want to use uiwait</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155215#389576</link>
      <author>G.A.M. </author>
      <description>Darik - thanks for your reply. You were correct about the&lt;br&gt;
HandleVisibility setting. I changed it to 'on'. However,&lt;br&gt;
after doing this I get the following error:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; set&lt;br&gt;
uipanel handle passed to 'CurrentFigure' property - valid&lt;br&gt;
figure handle required&lt;br&gt;
&lt;br&gt;
When I step through my code, I can check the validity of the&lt;br&gt;
figure's handle in the workspace. I'm not sure if this is&lt;br&gt;
the best debugging technique. However, what I find this way&lt;br&gt;
is that the handle becomes invalid as soon as the figure's&lt;br&gt;
initialization is complete.&lt;br&gt;
&lt;br&gt;
When I click on a uicontrol in the figure, the code to&lt;br&gt;
initialize is called all over again. I would have expected&lt;br&gt;
the figure to be initialized once -- unless it is closed. I&lt;br&gt;
would also have expected the figure's handle to remain valid&lt;br&gt;
unless the figure is closed or deleted.&lt;br&gt;
&lt;br&gt;
I have no idea why the figure's handle becomes invalid at&lt;br&gt;
the conclusion of initialization. Thanks.&lt;br&gt;
&lt;br&gt;
FYI, I posted a related question here:&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.cn/matlabcentral/newsreader/view_thread/155216&quot;&gt;http://www.mathworks.cn/matlabcentral/newsreader/view_thread/155216&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Darik &quot; &amp;lt;dgambleDEL@uwaterlooDEL.caDEL&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fav5tr$4ur$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I would guess that the figure's HandleVisibility is set to&lt;br&gt;
&amp;gt; 'Callback' - as a quick solution you could simply set it to&lt;br&gt;
&amp;gt; 'on' so callback functions for other figures are able to&lt;br&gt;
see it.&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
