closeField - Curious

pete at mollysrevenge.com pete at mollysrevenge.com
Sun Dec 19 02:53:23 EST 2010


Lots of input on this already but the bottom line is that closeField does
not get sent unless the user, not a script, changes the contents of a
field.  In your example, if the script of your button changes the content
of a field, no closeField event will be generated. I get round this by
sending a closeField message to the field after I've set the contents by
script.  That way you can do whatever you want whether the user changes
the contents or the script.

Personally, I think this implementation is wrong.  There are other events
like this, selectionChanged for example, and I have not come across a
single circumstance in any of my code where I did NOT want those events to
be generated when I did things in a script rather than the user doing
them.  What I'd like to see is something similar to the menuHistory and
label property of a button.  Change the label of a button by script -
menuPick doesn't happen.  Change the menuHistory by script - menuPick does
happen.

Pete

On Sat, December 18, 2010 1:57 pm, Mike Kerner wrote:
> OK, if I understand previous threads correctly, closeField does not get
> send
> when you click on a button.  So what happens if you click on a button that
> does something that causes the field to lose the focus - e.g. navigating
> to
> another card, putting different text in the field, selecting the text of
> another field, etc. what then?
>
> I guess I need a better explanation of when closeField does and does not
> get
> sent.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>






More information about the use-livecode mailing list