XObjectBase/GtkTreeViewColumn.js
[app.Builder.js] / XObjectBase / GtkTreeViewColumn.js
1
2 //<Script type="Text/javascript">
3
4 XObject = imports.XObject.XObject
5  
6 GObject = imports.gi.GObject;
7 //GtkClutter.Embed..
8 // children are not added at init / but at show stage..
9 // listener is added on show..
10 // we should really add a hock to destroy it..
11 GtkTreeViewColumn = XObject.define(
12     function(cfg) {
13         XObject.call(this, cfg);
14         // this is an example...
15        
16     }, 
17     XObject,
18     {
19         pack : function(parent, item) {
20             parent.el.append_column(this.el);
21             var n = 0;
22             var _t = this;
23             var col = 0;
24             var found = true; 
25             parent.items.forEach(function(e){
26                 if (found) {
27                     return true;
28                 }
29                 if (e == _t) {
30                     col = n;
31                     found = true;
32                     return;
33                 }
34                 if (XObject.type(e.xtype) == 'GtkTreeViewColumn') {
35                     n++;
36                 }
37             });
38             if (this.items.length) {
39                 this.el.add_attribute(this.items[0].el , 'markup', 4  );
40             }
41             
42             
43         }
44          
45     }
46 );