Re: Auto Scrolling





It seems to work for me except for some reason the ScrollingWindow always rescrolls to the top. Does anyone on the list know why this is happening or how I get it to stop?

Leo

Carlo wrote:

Leo Przybylski ha scritto lo scorso 28/10/2004 22.46:

Hello,

I'm trying to tail a file using a GtkTextView. Is that the right way I should be going about it? Does anyone have examples or anything for an autoscrolliing GtkTextView ???

Leo


You have to place a textiter at the end of your text buffer:

    gtk_text_buffer_get_end_iter (buffer, & end_iter);

move an already generated mark to such iter (you can generate it once for all, e.g. in a realize_event, and use it referencing by name until your textview lives; in this case I gave it the name "scroll"):

    gtk_text_buffer_move_mark_by_name (buffer, "scroll", & end_iter);

and finally scroll (tvShell here is the textview to which buffer is associated):

    gtk_text_view_scroll_mark_onscreen (
                               GTK_TEXT_VIEW (tvShell),
                               gtk_text_buffer_get_mark (
                                                   buffer,
                                                   "scroll"));

HTH

Carlo

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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