Scrolling to bottom of TextView?
- From: Martin Junius <mj+gnome ml m-j-s net>
- To: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Scrolling to bottom of TextView?
- Date: Mon, 10 Jan 2005 20:08:18 +0100
Dear all,
currently I'm using the following code to insert some lines at the end
of a TextView/TextBuffer (contained in a ScrolledWindow) and scroll to
the bottom:
my $buf = $gscript_textview->get_buffer;
$buf->place_cursor($buf->get_end_iter);
for (@_) {
$buf->insert_at_cursor($_ . "\n");
}
$buf->place_cursor($buf->get_end_iter);
my $mark = $buf->create_mark(undef, $buf->get_end_iter, 0);
$gscript_textview->scroll_mark_onscreen($mark);
$buf->delete_mark($mark);
This uses an otherwise superfluous mark for the scrolling.
Is this the canonical way or is there an easier way to achieve this
(without the mark)?
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]