Thanks Jacqueline, that's exactly what i was looking for. For reference, this is what i have working now:
In the field: global g_selection on mousedown theMouse put the selectedchunk into g_selection popup button "bt_popup" end mousedown in the popup button "bt_popup": global g_selection on menuPick pItemName select g_selection switch pItemName case "Non Breaking Space" put " " after the selection break case "Line Break" put "<br>" after the selection break end switch end menuPick Am 27.04.10 21:49, schrieb J. Landman Gay: > Claus Dreischer wrote: >> The problem was here was indeed the hilite. >> Putting >> put "hello world" into the selection >> or >> 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: > > local sStoredChunk > > on mouseDown > put the selectedchunk into sStoredChunk > end mouseDown > > on mouseUp > select sStoredChunk > end mouseUp > > on mouseRelease > select sStoredChunk > end mouseRelease > _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution