making tree widget scrollable.



Hi, 
I am rather newbie to all this gtk+ stuff so please bear with me.
I have been trying to create a scrolled window containing
tree widget. ( just like the tutorial says. see gtk_tut-13.html )
It compiles fine & stuff.. however, when I run it it will not create
the scroll bar with error saying

Gtk-WARNING **: gtk_scrolled_window_add(): cannot add non scrollable
widget use gtk_scrolled_window_add_with_viewport() instead

any help will be greatly appreciated.

I am using gtk/glib 1.2.0.
here is the code i wrote.

#include <gtk/gtk.h>

main (int argc, char** argv) {
        GtkWidget *a;
        GtkWidget *b;
        
        
        gtk_init ( &argc, &argv );
        a = gtk_scrolled_window_new ( NULL, NULL );
        gtk_widget_show ( a );
        b = gtk_tree_new ();
        gtk_widget_show ( b);
        
        gtk_container_add ( GTK_CONTAINER(a), b );
}

well.. I just wrote this up quickly to test the container thingy.
but even this simple example give me the same error.
Thanx in advance.

Ji Lee



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