--- a/ui/motif/text.c Sun Feb 15 15:44:24 2015 +0100 +++ b/ui/motif/text.c Tue Feb 17 20:12:22 2015 +0100 @@ -69,6 +69,7 @@ value->get = ui_textarea_get; value->getsubstr = ui_textarea_getsubstr; value->insert = ui_textarea_insert; + value->setposition = ui_textarea_setposition; value->position = ui_textarea_position; value->selection = ui_textarea_selection; value->length = ui_textarea_length; @@ -136,11 +137,16 @@ XmTextInsert(text->obj, pos, str); } +void ui_textarea_setposition(UiText *text, int pos) { + XmTextSetInsertionPosition(text->obj, pos); +} + int ui_textarea_position(UiText *text) { long begin; long end; XmTextGetSelectionPosition(text->obj, &begin, &end); - return begin; + text->pos = begin; + return text->pos; } void ui_textarea_selection(UiText *text, int *begin, int *end) {