请问如何获取treeview/treeviewcolumn的高度?我有简单的代码布局(里面是大树视图)和表格中的垂直滚动条。当我设置小的布局高度时,我看不到树视图的所有项目,当我设置它大时,我看到整个表格在布局底部有空白空间。是否可以设置布局,使其具有与 treeview 完全相同的高度或 treeviewcolumns 中的最大高度?提前致谢。一段代码:
tree = new Gtk.TreeView();
vadjustment = new Gtk.Adjustment(0, 0, 0, 0, 0, 0);
vscrollbar = new Gtk.VScrollbar(vadjustment);
Lyout layout = new Layout(null, vadjustment);
layout.Put(tree, 0, 0);
Table table = new Table(1, 2, false);
table.Attach(layout, 0, 1, 0, 1, Gtk.AttachOptions.Expand|Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand|Gtk.AttachOptions.Fill, 0, 0);
table.Attach(vscrollbar, 1, 2, 0, 1, Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink|Gtk.AttachOptions.Fill, 0, 0);
box.PackStart (table, true, true, 4);
vbox1.Add(box);
...
TreeViewColumn first = new TreeViewColumn();
first.Title=h1;
Gtk.CellRendererText first_name_cell = new Gtk.CellRendererText ();
first.PackStart(prvy_name_cell, true);
first_name_cell.Width=20;
...
tree.AppendColumn (first);
layout.SetSize(800, ???);
还有另一个问题 - 是否可以为树视图项目应用黑色边框颜色?