Re: TreeView column widths



On Apr 23, 2008, at 2:32 PM, Jonathon Jongsma wrote:

On Wed, Apr 23, 2008 at 2:20 PM, Joaquim Schmidlap
<schmidlap schmidlap org> wrote:
I have a TreeView that starts out displaying N columns. The TreeView
 is contained in a ScrolledWindow, which is on a page in a Notebook,
 which lives on the top level Window. The ScrolledWindow is set to
 POLICY_NEVER on the X axis, and POLICY_AUTOMATIC on the Y.

 The user can elect to "hide" certain columns on the TreeView. After
they are hidden, though, the rightmost column of the TreeView expands in width to fill whatever space the now-hidden columns used, with the
 net effect that the TreeView is always the same width.

  What I'd like is for the containing widgets all the way up to just
 get smaller as the columns are hidden (and grow again when they
 resurface). What's the best approach for this?

This probably can be accomplished by specifying a different packing
option for the scrolled window, but I'm not sure of the exact solution
from your description.

I have attached a small test program which exhibits the same behavior. I removed the Notebook for clarity, which made no difference. Perhaps this code makes my problem more clear?

Or, run it and see. Clicking the toggle button hides the first column, and the second column just sort of expands to fill the space that was there. The behavior is similar if there are many columns; it's always the rightmost one which grows.

Many thanks for any/all insight here.


Attachment: foo.cc
Description: Binary data






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