Persistant Insertion Point

Alex Tweedly alex at tweedly.net
Fri Sep 11 19:58:50 EDT 2020


You can save the insertion point (i.e. the selectedchunk) when you leave 
the second field, and then provide a handler to insert text at that 
saved point; and of course call that handler when needed

e.g.   in your "second field, have

> local sChunk
> on exitfield
>    put the selectedchunk into sChunk
>    put schunk &CR after msg
> end exitfield
>
> on closefield
>    put the selectedchunk into sChunk
>    put schunk &CR after msg
> end closefield
>
> on acceptText pText
>    do "put" && pText && "into" && sChunk
>    put "accepted" && schunk & Cr after msg
> end acceptText
and in the other field have something like

> ON selectionchanged
>    local tmp
>    put "here" &Cr after msg
>    put the mousetext into tmp
>    dispatch "accepttext" to fld 2 with tmp
>    put "disp" && it && the result &Cr after msg
> end selectionchanged
Alex.

On 12/09/2020 00:16, Roger Guay via use-livecode wrote:
> I have 2 fields, the first from which I take the mouseText, the second  into which I place that text. Trouble is, I want the placed text to be at the insertion point I had before clicking outside that field.
> Can someone suggest a way to preserve the insertion point in a field as one clicks into another field?
>
> I appreciate any help
> _______________________________________________
> 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