Scrolling to bottom of TextView?

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;

    for (@_) {
        $buf->insert_at_cursor($_ . "\n");

    my $mark = $buf->create_mark(undef, $buf->get_end_iter, 0);

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)?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]