Re: scrolling logs in GtkTextView to the end (Re: scrolling windows)


On 5/4/07, ibrar ahmed <sayaji99 yahoo com> wrote:

Please see this reference where this problem already handled, but there is
issue regarding work on FTP server.

I use the following code to append to a text buffer and scroll to the
bottom. It seems to work fine for me and doesn't need an idle handler:

               GtkTextView *text_view = GTK_TEXT_VIEW( trace->view );
               GtkTextBuffer *text_buffer = gtk_text_view_get_buffer(
text_view );
               GtkTextMark *mark = gtk_text_buffer_get_insert( text_buffer );
               GtkTextIter iter;

               gtk_text_buffer_get_end_iter( text_buffer, &iter );
               gtk_text_buffer_move_mark( text_buffer, mark, &iter );
               gtk_text_buffer_insert_at_cursor( text_buffer, buf, -1 );
               gtk_text_view_scroll_to_mark( text_view, mark, 0.0,
TRUE, 0.5, 1 );


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