Solution for closeField problem

Michael Binder runr at prismpole.com
Fri Jun 1 08:05:14 EDT 2007


Paul wrote:
> 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?

Ken wrote:
> Ah, now I understand... if you select from the menu, you're doing a
> mouseDown on the button that drops the Edit menu, which would trigger
> the "select empty" and remove the hilite from the currently selected
> text so there's nothing to copy.
>
> So I guess the "select empty" fix would have to check to see if the
> object you're mousing down on is a button in a menugroup.

So then, 'select empty' does work in the mousedown of non menu buttons?
For menu buttons, how about just putting the 'select empty' in the
menupick handler?

on menupick whichitem
    if whichitem <> "copy" and whichitem <>"Paste" then select empty

--Michael Binder




More information about the use-livecode mailing list