How to insert text at cursor position?
J. Landman Gay
jacque at hyperactivesw.com
Tue Apr 27 15:49:02 EDT 2010
Claus Dreischer wrote:
> The problem was here was indeed the hilite.
> put "hello world" into the selection
> put "hello world" after the selection
> in a button works.
> Putting one of the above into a popup button doen't work.
> So, is there a way to somehow "store" the selection before it get lost?
> Can i insert text into a field from a popup button?
You have a couple of choices. The easiest is to just turn off
auto-hilite and substitute your own handlers. On mousedown, hilite the
button, on mouseUp and mouseRelease, unhilite it.
The second way is to use a local script variable to store the
selectedchunk. When the button is released, reselect the stored chunk:
put the selectedchunk into sStoredChunk
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the Use-livecode