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
8 // tree view column.. should really have a better way to determin stuff..
9
10 GtkTreeViewColumn = XObject.define(
11     function(cfg) {
12         XObject.call(this, cfg);
13         // this is an example...
14        
15     }, 
16     XObject,
17     {
18         pack : function(parent, item) {
19             parent.el.append_column(this.el);
20             var n = 0;
21             var _t = this;
22             var col = 0;
23             var found = true; 
24             parent.items.forEach(function(e){
25                 if (found) {
26                     return true;
27                 }
28                 if (e == _t) {
29                     col = n;
30                     found = true;
31                     return;
32                 }
33                 if (XObject.type(e.xtype) == 'GtkTreeViewColumn') {
34                     n++;
35                 }
36             });
37             if (this.items.length) {
38                 this.el.add_attribute(this.items[0].el , 'markup', col );
39             }
40             
41             
42         }
43          
44     }
45 );