Closing a field by clicking a button -OS X

simplsol at aol.com simplsol at aol.com
Tue May 29 19:42:20 EDT 2007


Jacque,
Thanks for your (very prompt) response.
Unfortunately it does matter in this situation. setting the flag for 
unchanged fields will create unnecessary network traffic.
We need something that will not send the "closeField" unless the field 
has changed.
Another approach would be to "defocus" all fields after one has been 
edited but I don't know anyway to remove focus from all objects.
Of course the very best would be something that removed focus and sent 
closeField or exitField messages when other card/stack objects are 
selected.
PL


-----Original Message-----
From: J. Landman Gay <jacque at hyperactivesw.com>
To: How to use Revolution <use-revolution at lists.runrev.com>
Sent: Tue, 29 May 2007 4:01 pm
Subject: Re: Closing a field by clicking a button -OS X

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 

________________________________________________________________________
AOL now offers free email to everyone.  Find out more about what's free 
from AOL at AOL.com.
=0



More information about the use-livecode mailing list