this.add (hbox);
var sw = new Gtk.ScrolledWindow (null, null);
- sw.set_size_request (320, 20);
sw.set_policy (PolicyType.NEVER , PolicyType.AUTOMATIC);
sw.set_shadow_type (ShadowType.ETCHED_IN);
hbox.pack_start (sw, true, true, 0);
TabTreeCells.TREE_CELL_POINTER, view);
}
- this.set_default_size (320, list.len > 10 ? 232 : (int) list.len * 23 + 2);
this.treeview = new Gtk.TreeView.with_model (store);
this.treeview.set_fixed_height_mode (true);
sw.add (treeview);
TabTreeCells.TREE_CELL_STRING, "Title",
new CellRendererText (), "text", 1);
+ Requisition requisition;
+ int height;
+ int max_lines = 10;
+ this.treeview.size_request (out requisition);
+ if ((int)list.len > max_lines) {
+ height = requisition.height / (int)list.len * max_lines + 2;
+ } else {
+ height = requisition.height + 2;
+ }
+ sw.set_size_request (320, height);
+
this.show_all ();
}
public override void make_update () {