diff src/gtkimhtml.c @ 8729:7024b9145357

[gaim-migrate @ 9484] (16:29:26) marv: The patch adds a gtk_imhtml_scroll_to_bottom, and makes the history plugin use it. gtk_text_view_scroll_to_iter bad, gtk_text_view_scroll_to_mark good committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 20 Apr 2004 20:31:11 +0000
parents 3ac178eedac2
children 92cbf9713795
line wrap: on
line diff
--- a/src/gtkimhtml.c	Tue Apr 20 20:28:55 2004 +0000
+++ b/src/gtkimhtml.c	Tue Apr 20 20:31:11 2004 +0000
@@ -1747,19 +1747,26 @@
 	}
 
 	if (!(options & GTK_IMHTML_NO_SCROLL)) {
-		/* If this seems backwards at first glance, well it's not.
-		 * It means scroll such that the mark is closest to the top,
-		 * and closest to the right as possible. Remember kids, you have
-		 * to scroll left to move a given spot closest to the right,
-		 * and scroll down to move a spot closest to the top.
-		 */
-		gtk_text_iter_set_line_offset(&iter, 0);
-		gtk_text_buffer_move_mark(imhtml->text_buffer, imhtml->scrollpoint, &iter);
-		gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(imhtml), imhtml->scrollpoint,
-		                             0, TRUE, 1.0, 0.0);
+		gtk_imhtml_scroll_to_end(imhtml);
 	}
 }
 
+void gtk_imhtml_scroll_to_end(GtkIMHtml *imhtml)
+{
+	GtkTextIter iter;
+	/* If this seems backwards at first glance, well it's not.
+	 * It means scroll such that the mark is closest to the top,
+	 * and closest to the right as possible. Remember kids, you have
+	 * to scroll left to move a given spot closest to the right,
+	 * and scroll down to move a spot closest to the top.
+	 */
+	gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter);
+	gtk_text_iter_set_line_offset(&iter, 0);
+	gtk_text_buffer_move_mark(imhtml->text_buffer, imhtml->scrollpoint, &iter);
+	gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(imhtml), imhtml->scrollpoint,
+	                             0, TRUE, 1.0, 0.0);
+}
+
 void gtk_imhtml_insert_html_at_iter(GtkIMHtml        *imhtml,
                                     const gchar      *text,
                                     GtkIMHtmlOptions  options,