[Gtk-sharp-list] treeview header size

Andrei Ivanov andrei.ivanov@ines.ro
Sat, 24 Apr 2004 23:16:23 +0300 (EEST)


On Fri, 23 Apr 2004, John Luke wrote:

> On Thu, 2004-04-22 at 14:17 +0300, Andrei Ivanov wrote:
> > Hello,
> > I've created a treeview and I'm trying to alter the size of its header.
> > 
> > The only way that I found about how to get a reference to the buttons 
> > that create the header is like this:
> > 
> > CellRendererText renderer = new CellRendererText();
> > TreeViewColumn column = new TreeViewColumn("Name", renderer, "text", 0);
> > 
> > column.Widget = new Gtk.Label("aa");
> > column.Widget.Show();
> > treeview1.AppendColumn(column);
> > 
> > //column.Widget -> Label
> > //column.Widget.Parent -> Alignment
> > //column.Widget.Parent.Parent -> HBox
> > 
> > Gtk.Button header = (Gtk.Button)column.Widget.Parent.Parent.Parent;
> > 
> > My problem is that I don't know how to alter the size of that button.
> > 
> > In glade, the common properties tab of a normal button include width and 
> > height, but the header button doesn't seem to have them.
> > 
> 
> TreeViewColumn has FixedWidth, MaxWidth, and MinWidth properties, is
> that what you want? Or if you add the CellRenderer with PackStart to the
> column you can specify if you want it to expand or not.
> 
> This might be useful if it helps to have examples in C of the TreeView:
> http://scentric.net/tutorial/
> 

Unfortunately, that doesn't help me. I'm not trying to modify the column, 
but the header of the column, and more exactly, the distance between the 
label and the edge of the button. I've managed to modify the size of the 
button, but not the padding :(

This is what I've been doing:
//nothing changes
(column.Widget as Label).Ypad = 0;

Gtk.Box box = (Gtk.Box)column.Widget.Parent.Parent;

//nothing changes
box.Spacing = 0;

//it works, doesn't do what I want
box.HeightRequest = 10;

//doesn't make any difference
box.SetChildPacking(column.Widget.Parent, false, false, 0, Gtk.PackType.Start);