public static interface TextBuffer.NotifyCursorPosition
buffer.connect(new TextBuffer.NotifyCursorPosition()) { public void onNotifyCursorPosition(TextBuffer source) { final int offset; offset = buffer.getCursorPosition(); } });If you've already got the insert TextMark, then you could instead do:
buffer.connect(new TextBuffer.NotifyCursorPosition()) { public void onNotifyCursorPosition(TextBuffer source) { final TextIter pointer; final int offset; pointer = buffer.getIter(insertBound); offset = buffer.getOffset(); } });which amounts to the same thing.
Using the TextBuffer.NotifyCursorPosition
signal is much
more efficient than hooking up to TextBuffer.MarkSet
signals.
Modifier and Type | Method and Description |
---|---|
void |
onNotifyCursorPosition(TextBuffer source) |
void onNotifyCursorPosition(TextBuffer source)