Re: TreeView column widths



On Wed, 2008-04-23 at 14:20 -0500, Joaquim Schmidlap 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?

Gtk::TreeViewColumn::set_expand() should do what you want.  See:

http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeViewColumn.html#1de1f0cbd818083b9077b101250389c5

Set it true for each column.

Chris




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