problem with gtk_ctree_node_moveto()



Hello,

I'm trying to modify the icon file selector in the gtkextra
library so that the pre-selected directory (it's in a ctree)
shows up in the middle of its scrolled window, but
gtk_ctree_node_moveto() is not doing what I expected.

The gtkextra dir_tree (which is sub-classed from ctree) has been
packed into the scrolled window thus:

gtk_container_add(GTK_CONTAINER(scrolled_window),
                  filesel->dir_tree);

Now it comes time to display a directory, and there are two
relevant pieces of code:

(1) gtk_ctree_select(GTK_CTREE(dir_tree), root_node);

This works fine: the specified directory is highlighted.

(2)
   if (gtk_ctree_node_is_visible(GTK_CTREE(dir_tree), root_node)
      == GTK_VISIBILITY_NONE)
       gtk_ctree_node_moveto(GTK_CTREE(dir_tree), root_node, 0,
                             0.5, 0.5);

But this doesn't work.  The scrollbars surrounding the ctree
are adjusted "as if" to bring the root_node into view, but the
view of the ctree itself remains at the top, and the selected
node is not visible (you can find it by scrolling down).

Any suggestions?

Allin Cottrell.





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