From 15c4a4229f6cb5682e517ea901c2d3f91eb073a2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 2 Dec 2010 08:03:52 +0800 Subject: [PATCH] XObjectBase/GtkTreeViewColumn.js --- XObjectBase/GtkTreeViewColumn.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/XObjectBase/GtkTreeViewColumn.js b/XObjectBase/GtkTreeViewColumn.js index 73f4dc9c1..3198c8a77 100644 --- a/XObjectBase/GtkTreeViewColumn.js +++ b/XObjectBase/GtkTreeViewColumn.js @@ -16,15 +16,41 @@ GtkTreeViewColumn = XObject.define( }, XObject, { - pack : false, + pack : function(parent, item) { + parent.el.append_column(this.el); + var n = 0; + var _t = this; + var col = 0; + var found = true; + parent.items.forEach(function(e){ + if (found) { + return true; + } + if (e == _t) { + col = n; + found = true; + return; + } + if (XObject.type(e.xtype) == 'GtkTreeViewColumn') { + n++; + } + }); + if (this.items.length) { + this.el.add_attribute(this.items[0].el , 'markup', 4 ); + } + + + }, init : function() { // this is done before pack? - this.el = new Gtk.TreeViewColumn(); - this.parent.el.append_column(this.el); + // this.el = new Gtk.TreeViewColumn(); + // this.parent.el.append_column(this.el); XObject.prototype.init.call(this); + + if (this.items.length) { this.el.add_attribute(this.items[0].el , 'markup', 4 ); } -- 2.39.2