<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155685</link>
    <title>MATLAB Central Newsreader - How to give focus to GUI windows?</title>
    <description>Feed for thread: How to give focus to GUI windows?</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>Wed, 05 Sep 2007 19:24:16 -0400</pubDate>
      <title>How to give focus to GUI windows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155685#390903</link>
      <author>MathWizard</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
In my application I have a routine that takes some time to calculate &lt;br&gt;
things, then makes a graph using 'figure' and so on in order to save &lt;br&gt;
this using 'print', and then shows a messagebox that it's ready. If, &lt;br&gt;
during calculations, the user pops up another Windows application that &lt;br&gt;
covers my Matlab application on the screen, I see that:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;* The Matlab graphs do not get on top of the screen, and that for that &lt;br&gt;
reason the print statement does not save the contents of the graph to my &lt;br&gt;
disk, but the contents of the other Windows application on the place &lt;br&gt;
where the graph is supposed to be!&lt;br&gt;
&amp;nbsp;&amp;nbsp;* The messagebox stays underwater, covered by the other Windows &lt;br&gt;
application and the user doesn't know that it's there...&lt;br&gt;
&lt;br&gt;
Things like:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;* figure(fig_handle)&lt;br&gt;
&amp;nbsp;* figure(msgbox_handle)&lt;br&gt;
&amp;nbsp;* drawnow&lt;br&gt;
&lt;br&gt;
do not seem to get the figures or msgbox on top of the screen. Does &lt;br&gt;
anybody have a solution for this?&lt;br&gt;
&lt;br&gt;
Thanx,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Jeroen</description>
    </item>
    <item>
      <pubDate>Thu, 06 Sep 2007 06:50:10 -0400</pubDate>
      <title>Re: How to give focus to GUI windows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155685#390944</link>
      <author>Yair Altman</author>
      <description>MathWizard &amp;lt;no_mail@please.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;46df022e$0$12427$e4fe514c@dreader24.news.xs4all.nl&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In my application I have a routine that takes some time to&lt;br&gt;
calculate &lt;br&gt;
&amp;gt; things, then makes a graph using 'figure' and so on in&lt;br&gt;
order to save &lt;br&gt;
&amp;gt; this using 'print', and then shows a messagebox that it's&lt;br&gt;
ready. If, &lt;br&gt;
&amp;gt; during calculations, the user pops up another Windows&lt;br&gt;
application that &lt;br&gt;
&amp;gt; covers my Matlab application on the screen, I see that:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   * The Matlab graphs do not get on top of the screen, and&lt;br&gt;
that for that &lt;br&gt;
&amp;gt; reason the print statement does not save the contents of&lt;br&gt;
the graph to my &lt;br&gt;
&amp;gt; disk, but the contents of the other Windows application on&lt;br&gt;
the place &lt;br&gt;
&amp;gt; where the graph is supposed to be!&lt;br&gt;
&amp;gt;   * The messagebox stays underwater, covered by the other&lt;br&gt;
Windows &lt;br&gt;
&amp;gt; application and the user doesn't know that it's there...&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Try the following hack:&lt;br&gt;
jf=get(get(fig_handle,'JavaFrame'),'FigurePanelContainer');&lt;br&gt;
jf.getComponent(0).getRootPane.getTopLevelAncestor.setAlwaysOnTop(1);&lt;br&gt;
&lt;br&gt;
Note: this relies on undocumented &amp; unsupported Matlab&lt;br&gt;
functionality&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://ymasoftware.com&quot;&gt;http://ymasoftware.com&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 06 Sep 2007 17:32:20 -0400</pubDate>
      <title>Re: How to give focus to GUI windows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/155685#391015</link>
      <author>MathWizard</author>
      <description>Yair Altman wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;MathWizard &amp;lt;no_mail@please.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&amp;lt;46df022e$0$12427$e4fe514c@dreader24.news.xs4all.nl&amp;gt;...&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;Hi all,&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;In my application I have a routine that takes some time to&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;calculate &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;things, then makes a graph using 'figure' and so on in&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;order to save &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;this using 'print', and then shows a messagebox that it's&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;ready. If, &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;during calculations, the user pops up another Windows&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;application that &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;covers my Matlab application on the screen, I see that:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;  * The Matlab graphs do not get on top of the screen, and&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;that for that &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;reason the print statement does not save the contents of&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;the graph to my &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;disk, but the contents of the other Windows application on&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;the place &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;where the graph is supposed to be!&lt;br&gt;
&amp;gt;&amp;gt;  * The messagebox stays underwater, covered by the other&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;Windows &lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;application and the user doesn't know that it's there...&lt;br&gt;
&amp;gt;&amp;gt;    &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Try the following hack:&lt;br&gt;
&amp;gt;jf=get(get(fig_handle,'JavaFrame'),'FigurePanelContainer');&lt;br&gt;
&amp;gt;jf.getComponent(0).getRootPane.getTopLevelAncestor.setAlwaysOnTop(1);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Note: this relies on undocumented &amp; unsupported Matlab&lt;br&gt;
&amp;gt;functionality&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Yair Altman&lt;br&gt;
&amp;gt;&lt;a href=&quot;http://ymasoftware.com&quot;&gt;http://ymasoftware.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;&lt;br&gt;
It works! But you already knew that... Thanx :-)</description>
    </item>
  </channel>
</rss>

