janschenkel at yahoo.com
Tue Oct 21 05:33:06 EDT 2003
--- bleekerj at xs4all.nl wrote:
> > Hello list,
> > in my current projekt there are two questions (Mac
> OSX, RR 2.1):
> > 1) To save changed data in a stack, there is a
> ToBeSaved-Flag, which
> > gets set, if the contents of a field is changed.
> > Therefore each field has a closefield-handler,
> which sets the
> > ToBeSaved-Flag.
> > My problem: If I click the close-button immediatly
> after changing a
> > field, there is no closefield-message. What to do?
> the closefield-message got 'damaged' in v2 See bug
> #302: no
> closeField message sent after clicking a button.
> You have to wait for a new release :-(
> Jan Bleeker
Actually, I'm not sure that should be considered a bug
; it's more of an annoyance, but quite confusing
On MacOS, the field traditionally keeps the focus when
you click on a button -- partially because buttons
can't receive the focus from the keyboard.
On Windows, the user can traditionally use the tab-key
to whatever control he/she wants, including buttons,
checkboxes and the like.
So you can see that on MacOS, no closeField will be
sent, as the field is never closed when you click the
button (and in your case, not until the stack is
One way to work around this issue, is to check the
'focusedObject' from your button 'mouseUp', and if
it's a field, send it a 'closeField' message.
By the way, you might want to merge all your
'ToBeSaved' closeField handlers into a single
closeField handler in the stack script -- much easier
to maintain, and the closeField will travel down the
message path to your stack anyway.
If you're the adventurous type, this may be a good
time to learn about frontScripts to 'correct' the
standard behaviour : this will allow you to change
button mouseUps so that they send that closeField
Hope this helped,
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
More information about the Use-livecode