text selection question

Jeanne A. E. DeVoto revolution at jaedworks.com
Sun Jun 12 00:31:28 EDT 2005


At 1:16 PM -0400 6/11/2005, Bill Humphrey wrote:
>>>If the command select or focus on is run from and open fld or in 
>>>the message box then the selection just flashes for a second. If 
>>>it is run from a button on the card then it works as expected. 
>>>version 2.6 - what am I doing wrong?
>
>I would not have expected a simple "on open field" to have something 
>else happen after that changes the focus. I wonder what it is so I 
>can stop it?

Well, openField changes the focus sort of by definition.

If you want a word auto-selected, you'll need to delay the selection 
until after openField is finished. Try this:

  on openField
   if target is not empty then send doSelect to me in 1 tick
end openField

on doSelect
   select word 1 of me
end doSelect
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com


More information about the use-livecode mailing list