<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256047</link>
    <title>MATLAB Central Newsreader - Auto select editable text on tab in gui</title>
    <description>Feed for thread: Auto select editable text on tab in gui</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>Tue, 14 Jul 2009 00:07:05 -0400</pubDate>
      <title>Auto select editable text on tab in gui</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256047#665007</link>
      <author>Deepak </author>
      <description>Usually, in a GUI, when you press tab to go to a editable field, its contents are automatically selected, so that when you type something, the original contents get replaced by what you type. Apparently, Matlab GUIs do not do that by default. How can I do this? Basically in my GUI, each user input field has some default values. If the user wants to change these, he/she should simply be able to reach the field by pressing tab a few times, and then type in the new value. Right now, the user will have to first delete the original contents. &lt;br&gt;
&lt;br&gt;
Any help will be highly appreciated. &lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
Deepak</description>
    </item>
    <item>
      <pubDate>Tue, 14 Jul 2009 19:46:33 -0400</pubDate>
      <title>Re: Auto select editable text on tab in gui</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256047#665281</link>
      <author>Walter Roberson</author>
      <description>Deepak wrote:&lt;br&gt;
&amp;gt; Usually, in a GUI, when you press tab to go to a editable field, its contents are&lt;br&gt;
&amp;gt; automatically selected, so that when you type something, the original contents get&lt;br&gt;
&amp;gt; replaced by what you type. Apparently, Matlab GUIs do not do that by default.&lt;br&gt;
&amp;gt; How can I do this?&lt;br&gt;
&lt;br&gt;
-Possibly- someone has already contributed something like this to the Matlab File Exchange.&lt;br&gt;
If not, then you will need to have a KeyPressFunction for the field that figures out&lt;br&gt;
whether you just entered the field and if so then erases the previous contents. But&lt;br&gt;
even that is probably not what you want: probably you would like it so that if the user&lt;br&gt;
clicks somewhere in the field, then the original contents do not get removed (so that the&lt;br&gt;
user could edit the field.) If you want to get into that kind of sophistication then you&lt;br&gt;
will need to use java functions to manage the field. </description>
    </item>
  </channel>
</rss>

