<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800</link>
    <title>MATLAB Central Newsreader - twelti</title>
    <description>Feed for thread: twelti</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, 06 Nov 2008 20:55:04 -0500</pubDate>
      <title>twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#609452</link>
      <author>Todd Welti</author>
      <description>I have a strange problem.  I have a gui, with an edit box, with some default text in it.  The callback of the edit box executes when I click inside the box and then click outside the box, even though the text in the text box has not changed.  so: i open the gui, click on the first text bx, then click outside it, and the callback always executes, even though no change to the content of that text field.  I thought that somewhere, some other code was changing the contents of that field during initialization of the gui (perhaps a CreateFcn from another gui object), but i dont see that anywhere in the code.&lt;br&gt;
&lt;br&gt;
anyone ever had this problem?</description>
    </item>
    <item>
      <pubDate>Thu, 06 Nov 2008 21:26:10 -0500</pubDate>
      <title>Re: twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#609459</link>
      <author>Walter Roberson</author>
      <description>Todd Welti wrote:&lt;br&gt;
&amp;gt; I have a strange problem.  I have a gui, with an edit box, with some default text in it.&lt;br&gt;
&amp;gt; The callback of the edit box executes when I click inside the box and then click&lt;br&gt;
&amp;gt; outside the box, even though the text in the text box has not changed.&lt;br&gt;
&lt;br&gt;
That behaviour is consistent with the documentation for the Callback property of&lt;br&gt;
uicontrols:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; To execute the callback routine for an edit text control, type in the desired&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; text and then do one of the following:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Click another component, the menu bar, or the background of the GUI.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; For a single line editable text box, press Enter.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; For a multiline editable text box, press Ctl+Enter.&lt;br&gt;
&lt;br&gt;
You activated the control, you typed in the desired new text (which&lt;br&gt;
happened to be empty), and you clicked another component, the menu bar,&lt;br&gt;
or the background of the GUI, so as documented, the Callback fired.&lt;br&gt;
&lt;br&gt;
If it is presenting a problem, store the previous String value in the User&lt;br&gt;
field of the edit control, and when the Callback fires, get() the User field&lt;br&gt;
and compare it to the current String value, and if they are the same, return&lt;br&gt;
without doing anything (and if they differ, remember to save the new String&lt;br&gt;
into the User field.)&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
.signature note: I am now avoiding replying to unclear or ambiguous postings.&lt;br&gt;
Please review questions before posting them. Be specific. Use examples of what you mean,&lt;br&gt;
of what you don't mean. Specify boundary conditions, and data classes and value&lt;br&gt;
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?</description>
    </item>
    <item>
      <pubDate>Thu, 06 Nov 2008 22:11:02 -0500</pubDate>
      <title>Re: twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#609476</link>
      <author>Todd Welti</author>
      <description>Walter Roberson &amp;lt;roberson@hushmail.com&amp;gt; wrote in message &amp;lt;lhJQk.379$JW.62@newsfe01.iad&amp;gt;...&lt;br&gt;
&amp;gt; Todd Welti wrote:&lt;br&gt;
&amp;gt; &amp;gt; I have a strange problem.  I have a gui, with an edit box, with some default text in it.&lt;br&gt;
&amp;gt; &amp;gt; The callback of the edit box executes when I click inside the box and then click&lt;br&gt;
&amp;gt; &amp;gt; outside the box, even though the text in the text box has not changed.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; That behaviour is consistent with the documentation for the Callback property of&lt;br&gt;
&amp;gt; uicontrols:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; To execute the callback routine for an edit text control, type in the desired&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; text and then do one of the following:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; Click another component, the menu bar, or the background of the GUI.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; For a single line editable text box, press Enter.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; For a multiline editable text box, press Ctl+Enter.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You activated the control, you typed in the desired new text (which&lt;br&gt;
&amp;gt; happened to be empty), and you clicked another component, the menu bar,&lt;br&gt;
&amp;gt; or the background of the GUI, so as documented, the Callback fired.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If it is presenting a problem, store the previous String value in the User&lt;br&gt;
&amp;gt; field of the edit control, and when the Callback fires, get() the User field&lt;br&gt;
&amp;gt; and compare it to the current String value, and if they are the same, return&lt;br&gt;
&amp;gt; without doing anything (and if they differ, remember to save the new String&lt;br&gt;
&amp;gt; into the User field.)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; .signature note: I am now avoiding replying to unclear or ambiguous postings.&lt;br&gt;
&amp;gt; Please review questions before posting them. Be specific. Use examples of what you mean,&lt;br&gt;
&amp;gt; of what you don't mean. Specify boundary conditions, and data classes and value&lt;br&gt;
&amp;gt; relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?&lt;br&gt;
&lt;br&gt;
I thought I was clear, the text in the box did not change, I simply clicked in the box, then outside it.&lt;br&gt;
&lt;br&gt;
According to the documentation:&lt;br&gt;
&lt;br&gt;
Triggering Callback Execution&lt;br&gt;
&lt;br&gt;
If the contents of the edit text component have been changed, clicking inside the GUI but outside the edit text causes the edit text callback to execute. The user can also press Enter for an edit text that allows only a single line of text, or Ctrl+Enter for an edit text that allows multiple lines.</description>
    </item>
    <item>
      <pubDate>Thu, 06 Nov 2008 23:47:44 -0500</pubDate>
      <title>Re: twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#609490</link>
      <author>Walter Roberson</author>
      <description>Todd Welti wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; According to the documentation:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Triggering Callback Execution&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If the contents of the edit text component have been changed, clicking inside the GUI [...]&lt;br&gt;
&lt;br&gt;
You are perhaps reading summary documentation that is incorrect. The documentation I&lt;br&gt;
quoted was taken directly from the R2008a uicontrol properties page; I see that the&lt;br&gt;
R2008b documentation is substantially the same:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
The reference documentation for any particular function must be considered to&lt;br&gt;
override any summary documentation or user guide.&lt;br&gt;
&lt;br&gt;
&amp;gt; I thought I was clear, the text in the box did not change, I simply clicked in the box,&lt;br&gt;
&amp;gt; then outside it.&lt;br&gt;
&lt;br&gt;
Yep, and as I quoted,&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; To execute the callback routine for an edit text control, type in the desired text and&lt;br&gt;
&lt;br&gt;
You -did- type in your desired text, which happened to be the empty set of text.&lt;br&gt;
&lt;br&gt;
Suppose the postman walks up to your mailbox, opens it up, pulls bundle of letters out of&lt;br&gt;
his (or her) sack to put in your mailbox, takes a second glance at the letters and realizes&lt;br&gt;
that they are for next-door instead, and so closes your mailbox and leaves again. Zero&lt;br&gt;
letters (the empty set of letters) would have been transfered to your mailbox, but the&lt;br&gt;
mailbox would still have been opened by the postman. And if you have your mailbox rigged&lt;br&gt;
to ring a bell inside &quot;when you get new letters&quot; then chances are that it is really&lt;br&gt;
rigged to detect the mailbox opening and closing rather than the presence of letters.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
If that isn't enough of an explanation:&lt;br&gt;
&lt;br&gt;
Suppose you click in an edit control and you move the cursor around and you type new&lt;br&gt;
things and you delete old things, and at the end of all of your changes, the new text&lt;br&gt;
happens to be -exactly- the same as the old text. Then the content hasn't changed relative&lt;br&gt;
to what it used to be, right? But the control doesn't know that: all that it knows is&lt;br&gt;
that you went in and you did -something- (even if it was just clicking around and&lt;br&gt;
not doing any typing... well, keyboard isn't proof since you might have used mouse or&lt;br&gt;
you might have used voice commands to make your changes). Controls -could- keep track&lt;br&gt;
of their previous content and -could- compare the old content against the new content&lt;br&gt;
and skip the callback if the content was identical, but it simply isn't worth the trouble&lt;br&gt;
or the extra storage to do so in general. You can follow the procedure I outlined before if&lt;br&gt;
the extra execution is a serious problem.&lt;br&gt;
&lt;br&gt;
If you really really don't like the way it is handled, then you can file an enhancement&lt;br&gt;
request (but don't seriously expect that Mathworks will actually change the behaviour&lt;br&gt;
considering the cost of that storage and the low gain involved). Or you could look up old&lt;br&gt;
postings written by Yair Altman and find out how to customize uicontrol behaviours at&lt;br&gt;
the Java level.&lt;br&gt;
&lt;br&gt;
The behaviour you are seeing is standard Matlab uicontrol('Style','edit') behaviour.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
.signature note: I am now avoiding replying to unclear or ambiguous postings.&lt;br&gt;
Please review questions before posting them. Be specific. Use examples of what you mean,&lt;br&gt;
of what you don't mean. Specify boundary conditions, and data classes and value&lt;br&gt;
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?</description>
    </item>
    <item>
      <pubDate>Fri, 07 Nov 2008 01:07:02 -0500</pubDate>
      <title>Re: twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#609499</link>
      <author>Todd Welti</author>
      <description>Walter Roberson &amp;lt;roberson@hushmail.com&amp;gt; wrote in message &amp;lt;3mLQk.1735$Bp.1425@newsfe01.iad&amp;gt;...&lt;br&gt;
&amp;gt; Todd Welti wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; According to the documentation:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Triggering Callback Execution&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If the contents of the edit text component have been changed, clicking inside the GUI [...]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You are perhaps reading summary documentation that is incorrect. The documentation I&lt;br&gt;
&amp;gt; quoted was taken directly from the R2008a uicontrol properties page; I see that the&lt;br&gt;
&amp;gt; R2008b documentation is substantially the same:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The reference documentation for any particular function must be considered to&lt;br&gt;
&amp;gt; override any summary documentation or user guide.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I thought I was clear, the text in the box did not change, I simply clicked in the box,&lt;br&gt;
&amp;gt; &amp;gt; then outside it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yep, and as I quoted,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; To execute the callback routine for an edit text control, type in the desired text and&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You -did- type in your desired text, which happened to be the empty set of text.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Suppose the postman walks up to your mailbox, opens it up, pulls bundle of letters out of&lt;br&gt;
&amp;gt; his (or her) sack to put in your mailbox, takes a second glance at the letters and realizes&lt;br&gt;
&amp;gt; that they are for next-door instead, and so closes your mailbox and leaves again. Zero&lt;br&gt;
&amp;gt; letters (the empty set of letters) would have been transfered to your mailbox, but the&lt;br&gt;
&amp;gt; mailbox would still have been opened by the postman. And if you have your mailbox rigged&lt;br&gt;
&amp;gt; to ring a bell inside &quot;when you get new letters&quot; then chances are that it is really&lt;br&gt;
&amp;gt; rigged to detect the mailbox opening and closing rather than the presence of letters.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If that isn't enough of an explanation:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Suppose you click in an edit control and you move the cursor around and you type new&lt;br&gt;
&amp;gt; things and you delete old things, and at the end of all of your changes, the new text&lt;br&gt;
&amp;gt; happens to be -exactly- the same as the old text. Then the content hasn't changed relative&lt;br&gt;
&amp;gt; to what it used to be, right? But the control doesn't know that: all that it knows is&lt;br&gt;
&amp;gt; that you went in and you did -something- (even if it was just clicking around and&lt;br&gt;
&amp;gt; not doing any typing... well, keyboard isn't proof since you might have used mouse or&lt;br&gt;
&amp;gt; you might have used voice commands to make your changes). Controls -could- keep track&lt;br&gt;
&amp;gt; of their previous content and -could- compare the old content against the new content&lt;br&gt;
&amp;gt; and skip the callback if the content was identical, but it simply isn't worth the trouble&lt;br&gt;
&amp;gt; or the extra storage to do so in general. You can follow the procedure I outlined before if&lt;br&gt;
&amp;gt; the extra execution is a serious problem.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you really really don't like the way it is handled, then you can file an enhancement&lt;br&gt;
&amp;gt; request (but don't seriously expect that Mathworks will actually change the behaviour&lt;br&gt;
&amp;gt; considering the cost of that storage and the low gain involved). Or you could look up old&lt;br&gt;
&amp;gt; postings written by Yair Altman and find out how to customize uicontrol behaviours at&lt;br&gt;
&amp;gt; the Java level.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The behaviour you are seeing is standard Matlab uicontrol('Style','edit') behaviour.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The text from Uicontrol Properties::Functions, is similar to what I quoted, in that it doesn't really say specifically that just clicking in the box &quot;modifies&quot; the data in it.  In any case this can't be right because it only happens the first time after i load the GUI!  After the first time, it does not cause the callback to execute.  Matlab tech support sent me a simple gui that did not exhibit this behaviour.  I think that there is somehting in the initialization of the gui that causes the edit box data to appear to have been changed.  &lt;br&gt;
&lt;br&gt;
I will check out the java customization, sounds interesting.</description>
    </item>
    <item>
      <pubDate>Mon, 10 Nov 2008 17:28:02 -0500</pubDate>
      <title>Re: twelti</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238800#610101</link>
      <author>Todd Welti</author>
      <description>&quot;Todd Welti&quot; &amp;lt;twelti@harman.com&amp;gt; wrote in message &amp;lt;gevlj8$fpq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a strange problem.  I have a gui, with an edit box, with some default text in it.  The callback of the edit box executes when I click inside the box and then click outside the box, even though the text in the text box has not changed.  so: i open the gui, click on the first text bx, then click outside it, and the callback always executes, even though no change to the content of that text field.  I thought that somewhere, some other code was changing the contents of that field during initialization of the gui (perhaps a CreateFcn from another gui object), but i dont see that anywhere in the code.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; anyone ever had this problem?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Further:&lt;br&gt;
&lt;br&gt;
Hello Todd,&lt;br&gt;
&lt;br&gt;
This is definitely a bug. I am reporting this to our developers. Thank you for bringing this up.&lt;br&gt;
&lt;br&gt;
As a workaround, I have modified your file a little. I am storing the original string content ot edit2 as a guidata. Second, in the callback for edit2, I compare this with the current value of 'String'. If you have modified the content, only then the callback will execute.&lt;br&gt;
&lt;br&gt;
Please let me know of your thoughts on this.&lt;br&gt;
&lt;br&gt;
Sincerely,&lt;br&gt;
Aditya Joshi</description>
    </item>
  </channel>
</rss>

