When has a field changed?

Pete pete at mollysrevenge.com
Tue Oct 25 20:03:28 EDT 2011


James,
The button click/closeField problem happens because, on OS X anyway, the
filed doesn;t lose focus when you click on the button (you'll see the cursor
is still in it).  Put "focus on nothing" at the top of your button's
mouseDown handler.  That removes focus from the field thus causing the
closeField event to happen if the content changed, or exitField if nothing
changed.

Not sure if this has been mentioned in this thread but you don't get a
closeField if you change a field's contents by script, which may or may not
be a problem depending on your application.  The workaround is to send
closeField to the field in your script.

Hope that helps,

Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Tue, Oct 25, 2011 at 4:24 PM, James Hurley <jhurley0305 at sbcglobal.net>wrote:

> Thanks all for the info about the effect of closeField.
>
> I have assumed that it was called only when a field is closed.
>
> As you point out  it is also called when the field loses focus.
>
> It appears that that will happen when one clicks in another field or on the
> card, BUT not when one immediately clicks on another button.
>
> That would be a problem in my application. The user could change the field
> and then immediately click a button, a button that will not see the effect
> of the chance in the field.
>
> My tortured script at least sends the "change" message as soon as the mouse
> leave the field.
>
> Jim
> _______________________________________________
> 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