Closing a field by clicking a button -OS X
J. Landman Gay
jacque at hyperactivesw.com
Tue May 29 19:01:38 EDT 2007
simplsol at aol.com wrote:
> I need to set a flag in on a card when the contents of any of the fields
> on that card change.
>
> This almost works:
>
> on closeField
> setTheFlag
> end closeField
>
> The problem occurs when the user clicks a button, or uses the menu to
> leave the card. On OS X the closeField command is not sent when leaving
> a field under these circumstances - the field never loses focus.
>
> Is there a good way to send a message (like closeField) when the user
> edits a field then clicks elsewhere?
This has caught me too. Try something like this in the card or stack script:
on mousedown
get the selectedfield
if it <> "" then send "closefield" to it
end mousedown
This doesn't test whether a field has changed and so should really get a
closefield message, but depending on your stack that may not matter.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list