Re: How to create a scrolled text window with GTK 2.x?



Hi

>   I have also tried this:
>
>     GtkWidget* textWindow = gtk_text_view_new();
>     GtkWidget* scrolledTextWindow = gtk_scrolled_window_new(NULL, NULL);
>     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledTextWindow),
>                                    GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
>     gtk_scrolled_window_add_with_viewport
>         (GTK_SCROLLED_WINDOW(scrolledTextWindow), textWindow);

Textview has native scrolling, so use:
gtk_container_add( GTK_CONTAINER( scrolledTextWindow ), textWindow );

This will scroll when you type - I'm not sure what happens, if you add
text via the gtk_text_buffer_* funtions.

About the GtkPaned stuff:

I had a look at the code, and there aren't any signals emitted. Seems
nobody cared about the widget for a long time. Best would be to create a
bug report. Maybe you want to provide a proper implementation.

Jan-Marek



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