X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=7a03ffb581050f68f14a5f4046f18af1ffb0cdd2;hb=0290d2bc845bbd6445d22176ceb88ca5a7dc3422;hp=0eb165880ef81bbfbc24aa14c3f203ff6b11c6e5;hpb=7801dc7d61bc47273aa27cd65f60bc42e6f5a859;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 0eb1658..7a03ffb 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -317,8 +317,13 @@ void ScrollToCursor (Option *opt, int caretPos) { static GtkTextIter iter; + static GtkTextMark *mark; + if(!mark) mark = gtk_text_mark_new(NULL, 0); gtk_text_buffer_get_iter_at_offset((GtkTextBuffer *) opt->handle, &iter, caretPos); - gtk_text_view_scroll_to_iter((GtkTextView *) opt->textValue, &iter, 0.0, 0, 0.5, 0.5); + gtk_text_buffer_add_mark((GtkTextBuffer *) opt->handle, mark, &iter); + gtk_text_view_scroll_to_mark((GtkTextView *) opt->textValue, mark, 0.0, 0, 0.5, 0.5); +// gtk_text_view_scroll_to_iter((GtkTextView *) opt->textValue, &iter, 0.0, 0, 0.5, 0.5); + gtk_text_buffer_delete_mark((GtkTextBuffer *) opt->handle, mark); } int