Path: news.mathworks.com!not-for-mail
From: "Todd Welti" <twelti@harman.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: twelti
Date: Fri, 7 Nov 2008 01:07:02 +0000 (UTC)
Organization: Harman Industries International
Lines: 64
Message-ID: <gf04bm$8l$1@fred.mathworks.com>
References: <gevlj8$fpq$1@fred.mathworks.com> <lhJQk.379$JW.62@newsfe01.iad> <gevq1m$g81$1@fred.mathworks.com> <3mLQk.1735$Bp.1425@newsfe01.iad>
Reply-To: "Todd Welti" <twelti@harman.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226020022 277 172.30.248.37 (7 Nov 2008 01:07:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 7 Nov 2008 01:07:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 57524
Xref: news.mathworks.com comp.soft-sys.matlab:499422


Walter Roberson <roberson@hushmail.com> wrote in message <3mLQk.1735$Bp.1425@newsfe01.iad>...
> Todd Welti wrote:
> 
> > According to the documentation:
> > 
> > Triggering Callback Execution
> > 
> > If the contents of the edit text component have been changed, clicking inside the GUI [...]
> 
> You are perhaps reading summary documentation that is incorrect. The documentation I
> quoted was taken directly from the R2008a uicontrol properties page; I see that the
> R2008b documentation is substantially the same:
> 
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html
> 
> The reference documentation for any particular function must be considered to
> override any summary documentation or user guide.
> 
> > I thought I was clear, the text in the box did not change, I simply clicked in the box,
> > then outside it.
> 
> Yep, and as I quoted,
> 
> >>> To execute the callback routine for an edit text control, type in the desired text and
> 
> You -did- type in your desired text, which happened to be the empty set of text.
> 
> Suppose the postman walks up to your mailbox, opens it up, pulls bundle of letters out of
> his (or her) sack to put in your mailbox, takes a second glance at the letters and realizes
> that they are for next-door instead, and so closes your mailbox and leaves again. Zero
> letters (the empty set of letters) would have been transfered to your mailbox, but the
> mailbox would still have been opened by the postman. And if you have your mailbox rigged
> to ring a bell inside "when you get new letters" then chances are that it is really
> rigged to detect the mailbox opening and closing rather than the presence of letters.
> 
> 
> If that isn't enough of an explanation:
> 
> Suppose you click in an edit control and you move the cursor around and you type new
> things and you delete old things, and at the end of all of your changes, the new text
> happens to be -exactly- the same as the old text. Then the content hasn't changed relative
> to what it used to be, right? But the control doesn't know that: all that it knows is
> that you went in and you did -something- (even if it was just clicking around and
> not doing any typing... well, keyboard isn't proof since you might have used mouse or
> you might have used voice commands to make your changes). Controls -could- keep track
> of their previous content and -could- compare the old content against the new content
> and skip the callback if the content was identical, but it simply isn't worth the trouble
> or the extra storage to do so in general. You can follow the procedure I outlined before if
> the extra execution is a serious problem.
> 
> If you really really don't like the way it is handled, then you can file an enhancement
> request (but don't seriously expect that Mathworks will actually change the behaviour
> considering the cost of that storage and the low gain involved). Or you could look up old
> postings written by Yair Altman and find out how to customize uicontrol behaviours at
> the Java level.
> 
> The behaviour you are seeing is standard Matlab uicontrol('Style','edit') behaviour.
> 
> -- 


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 "modifies" 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.  

I will check out the java customization, sounds interesting.