IMContext.setSurroundingWithSelection

void setSurroundingWithSelection(string text, int cursorIndex, int anchorIndex)

Sets surrounding context around the insertion point and preedit string. This function is expected to be called in response to the signalGtk.IMContext::retrieve_surrounding signal, and will likely have no effect if called at other times.

Parameters

texttext surrounding the insertion point, as UTF-8. the preedit string should not be included within text
cursorIndexthe byte index of the insertion cursor within text
anchorIndexthe byte index of the selection bound within text