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

autoresize of ctree?



Hi,

got here a little problem with my directory-browser (implemented as ctree)
(Gtk 1.2.6)

Works fine, but when the user descends so far in the directory hierachy,
that the tree is getting wider as the screen, there wont be a
horizontal scrollbar displayed.

I tried several things and the only a call like:

        gtk_clist_set_column_auto_resize(GTK_CLIST(ctree),0,TRUE); 
	(this seems to be missing for ctrees)

has the desired effect - but this produces a lot of 

Gdk-CRITICAL **: file gdkfont.c: line 304 (gdk_string_width): assertion `string != NULL' failed.

errors...

Can anybody give me a pointer how to put a ctree in a scrolled window
to make the scrollbars works as expected?

Here is the code snipplet:

        scrolled_win = gtk_scrolled_window_new (NULL, NULL);
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
                GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
        gtk_box_pack_start(GTK_BOX(vbox),scrolled_win,TRUE,TRUE,0);
        gtk_widget_realize(scrolled_win);
        gtk_widget_show(scrolled_win);

        ctree = create_directory_ctree("/",NULL,toplevel,entry1, 1);
	/* gtk_clist_set_column_auto_resize(GTK_CLIST(ctree),0,TRUE); */

        gtk_container_add (GTK_CONTAINER (scrolled_win), GTK_WIDGET (ctree));
        gtk_widget_show( GTK_WIDGET (ctree));

Tried also instead of gtk_container_add:

        gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_win),
                GTK_WIDGET (ctree));


thanks for any hints..

-- 
  ___ ___
 /   |   \  ___________   | REAL   : Thomas Niederreiter: Munich, Germany
/    ~    \/  _ \_  __ \  | EMAIL  : tn@rz.fh-muenchen.de
\    Y    (  <_> )  | \/  | WEB    : www.xcdroast.org
 \___|_  / \____/|__|     |



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