comparison 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
comparison
equal deleted inserted replaced
8728:268461757fd6 8729:7024b9145357
1745 gtk_text_buffer_get_iter_at_offset(imhtml->text_buffer, &sel, sel_offset); 1745 gtk_text_buffer_get_iter_at_offset(imhtml->text_buffer, &sel, sel_offset);
1746 gtk_text_buffer_move_mark(imhtml->text_buffer, gtk_text_buffer_get_selection_bound(imhtml->text_buffer), &sel); 1746 gtk_text_buffer_move_mark(imhtml->text_buffer, gtk_text_buffer_get_selection_bound(imhtml->text_buffer), &sel);
1747 } 1747 }
1748 1748
1749 if (!(options & GTK_IMHTML_NO_SCROLL)) { 1749 if (!(options & GTK_IMHTML_NO_SCROLL)) {
1750 /* If this seems backwards at first glance, well it's not. 1750 gtk_imhtml_scroll_to_end(imhtml);
1751 * It means scroll such that the mark is closest to the top, 1751 }
1752 * and closest to the right as possible. Remember kids, you have 1752 }
1753 * to scroll left to move a given spot closest to the right, 1753
1754 * and scroll down to move a spot closest to the top. 1754 void gtk_imhtml_scroll_to_end(GtkIMHtml *imhtml)
1755 */ 1755 {
1756 gtk_text_iter_set_line_offset(&iter, 0); 1756 GtkTextIter iter;
1757 gtk_text_buffer_move_mark(imhtml->text_buffer, imhtml->scrollpoint, &iter); 1757 /* If this seems backwards at first glance, well it's not.
1758 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(imhtml), imhtml->scrollpoint, 1758 * It means scroll such that the mark is closest to the top,
1759 0, TRUE, 1.0, 0.0); 1759 * and closest to the right as possible. Remember kids, you have
1760 } 1760 * to scroll left to move a given spot closest to the right,
1761 * and scroll down to move a spot closest to the top.
1762 */
1763 gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter);
1764 gtk_text_iter_set_line_offset(&iter, 0);
1765 gtk_text_buffer_move_mark(imhtml->text_buffer, imhtml->scrollpoint, &iter);
1766 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(imhtml), imhtml->scrollpoint,
1767 0, TRUE, 1.0, 0.0);
1761 } 1768 }
1762 1769
1763 void gtk_imhtml_insert_html_at_iter(GtkIMHtml *imhtml, 1770 void gtk_imhtml_insert_html_at_iter(GtkIMHtml *imhtml,
1764 const gchar *text, 1771 const gchar *text,
1765 GtkIMHtmlOptions options, 1772 GtkIMHtmlOptions options,