Applied patch from bug #9972 to fix gtk2 memo.selstart

git-svn-id: trunk@12524 -
This commit is contained in:
andrew 2007-10-19 22:40:27 +00:00
parent 3484e045f2
commit 2d6ece4fb8

View File

@ -189,10 +189,12 @@ var
TextIter: TGtkTextIter;
begin
if not ACustomEdit.HandleAllocated then exit;
TextView := PGtkTextView(GetWidgetInfo(Pointer(ACustomEdit.Handle), False)^.CoreWidget);
TextBuffer := gtk_text_view_get_buffer(TextView);
gtk_text_buffer_get_iter_at_offset(TextBuffer, @TextIter, NewStart);
gtk_text_buffer_place_cursor(TextBuffer, @TextIter);
gtk_text_buffer_place_cursor(TextBuffer, @TextIter); // needed to move the cursor
gtk_text_view_scroll_to_iter(TextView, @TextIter, 0, False, 0, 0); // this ensures the cursor is visible
end;
class procedure TGtk2WSCustomMemo.SetSelLength(const ACustomEdit: TCustomEdit;