[gtkada] Update CTree contents and horizontal scrollbars

Marc A. Criley mcq95 at earthlink.net
Fri Jul 19 15:25:13 CEST 2002


I am using a CTree for data display.  The structure of the tree, once built,
does not change.  By the "structure", I mean the hierarchy--the number of
branches, which branches have subtrees, and so on--none of that changes
after the tree has been created.

What does change, though, is the text associated with each branch.  I know
how to do this and display the updates and that is all working just fine.

What is not working, though, is what happens when the new branch text is
longer than the previous value, i.e., the text that was present when the
tree was originally built.  As each tree is displayed in its own little
"data window" I want to have horizontal adjustment sliders rather than
forcing the window to have to be resized to view the new values.

I'm displaying the tree in a Gtk.Scrolled_Window, with the Scrollbar_Policy
for both Horizontal and Vertical intended to be set to Policy_Automatic.
Despite doing this, when the node text ends up wider than the window, no
horizontal scrollbar appears.  And if I set the policy to Policy_Always,
there's a horizontal scrollbar, but the occupied portion of the scrollbox is
not recalculated after the text is updated.

I've tried using the Set_Column_Auto_Resize procedure, with no effect, and
poked around at trying some stuff with Adjustments, but not yet having any
success.

I would appreciate any suggestions on how to get the scrollbars to work
properly in this situation.

Thanks,

Marc A. Criley






More information about the gtkada mailing list