A Dom, 2003-09-07 �s 17:44, Martin Preishuber escreveu:
> Hi all,
> 
> I tried to solve the following small problem for the 3rd time now and
> didn't find a solution, so I thought I'd ask here :) The problem is the
> following:
> 
> I have a ScrolledWindow containing a TextView widget with a TextBuffer.
> I insert text into the TextBuffer with .insert_at_cursor(text). Now that
> works fine, except that the visible lines are always the first few
> lines, so it doesn't scroll down automatically. 
> How do I automatically scroll down to the latest line ? I played around
> with TextView.place_cursor_on_screen(), scroll_iter() and co but with no
> success :( Any ideas ?

  I have this old code from my project:

void console_view_scroll_to_bottom(ConsoleView *self)
{
    GtkTextBuffer *textbuf;
    GtkTextMark *end_mark;
    textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(self->text_view));
    end_mark = gtk_text_buffer_get_mark(textbuf, "end-of-buffer");
    gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(self->text_view), end_mark,
                                 0, TRUE, 0.0, 1.0);
}

  Now, translate that to Python. :)

> 
> Thanks,
> 
> Martin
-- 
Gustavo Jo�o Alves Marques Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to