Selection strategies

Richard Gaskin ambassador at fourthworld.com
Thu Feb 26 18:03:33 EST 2004


Chipp Walters wrote:

 > Richard Gaskin wrote:
 >
 >> I'm making a toolbar in a palette window which modifies text in a
 >> field in a toplevel stack.  I find that when text is selected in the
 >> field the palette buttons work great, but if the cursor is inserted
 >> with no selection then clicking in the palette window causes the
 >> field to lose focus.
 >>
 >> Any of you know how to make that work?
>
> if the selectedText of fld 1 of stack "Untitled 1" is empty then
>     focus on fld 1 of stack "Untitled 1"
> end if
> 
> I tried it here and it works.

With one limitation  I didn't mention: one of the reasons I need the 
selection is to determine which field is being edited.  The layout has a 
number of fields.

I could set a var on openfield, but that just seems unclean and 
ultimately error prone.  If nothing else surfaces I'll give it a shot.

Thanks for the assist -

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list