"|xns": "Gtk"
}
]
- },
- {
- "pack": "pack_end,true,true,3",
- "xtype": "ScrolledWindow",
- "|shadow_type": "Gtk.ShadowType.IN",
- "|xns": "Gtk",
- "items": [
- {
- "pack": "add",
- "xtype": "TreeView",
- "|init": "function() {\n XObject.prototype.init.call(this);\n var description = new Pango.FontDescription.c_new();\n description.set_size(8000);\n this.el.modify_font(description);\n\n this.selection = this.el.get_selection();\n this.selection.set_mode( Gtk.SelectionMode.SINGLE);\n var _t = this;\n\n // is this really needed??\n this.selection.signal['changed'].connect(function() {\n print('selection changed');\n \n\n });\n\n}\n",
- "|xns": "Gtk",
- "items": [
- {
- "id": "model",
- "pack": "set_model",
- "xtype": "ListStore",
- "|columns": " [\n GObject.TYPE_STRING, // title \n GObject.TYPE_STRING, // tip\n GObject.TYPE_STRING // source..\n] ",
- "|init": "function() {\n XObject.prototype.init.call(this);\n\n this.el.set_column_types ( 2, [\n GObject.TYPE_STRING, // real key\n GObject.TYPE_STRING // real type\n \n \n ] );\n\n var Repo = imports.Scm.Repo.Repo;\n var t = this;\n imports.Tasks.Tasks.list(Repo.get('gitlive'), function(res) { \n t.loadData(res);\n });\n \n \n}\n",
- "|loadData": "function (data) {\n \n var iter = new Gtk.TreeIter();\n var el = this.el;\n data.forEach(function(p) {\n \n el.append(iter);\n \n \n el.set_value(iter, 0, p.id);\n el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );\n \n });\n \n \n}\n",
- "|xns": "Gtk"
- },
- {
- "pack": "append_column",
- "xtype": "TreeViewColumn",
- "|init": "function() {\n XObject.prototype.init.call(this);\n this.el.add_attribute(this.items[0].el , 'markup', 0 );\n}\n",
- "|xns": "Gtk",
- "items": [
- {
- "pack": "pack_start",
- "xtype": "CellRendererText",
- "|xns": "Gtk"
- }
- ]
- }
- ]
- }
- ]
}
]
}
use_stock : true
}
]
- },
- {
- xtype: Gtk.ScrolledWindow,
- pack : "pack_end,true,true,3",
- shadow_type : Gtk.ShadowType.IN,
- items : [
- {
- xtype: Gtk.TreeView,
- pack : "add",
- init : function() {
- XObject.prototype.init.call(this);
- var description = new Pango.FontDescription.c_new();
- description.set_size(8000);
- this.el.modify_font(description);
-
- this.selection = this.el.get_selection();
- this.selection.set_mode( Gtk.SelectionMode.SINGLE);
- var _t = this;
-
- // is this really needed??
- this.selection.signal['changed'].connect(function() {
- print('selection changed');
-
-
- });
-
- },
- items : [
- {
- xtype: Gtk.ListStore,
- id : "model",
- pack : "set_model",
- columns : [
- GObject.TYPE_STRING, // title
- GObject.TYPE_STRING, // tip
- GObject.TYPE_STRING // source..
- ],
- init : function() {
- XObject.prototype.init.call(this);
-
- this.el.set_column_types ( 2, [
- GObject.TYPE_STRING, // real key
- GObject.TYPE_STRING // real type
-
-
- ] );
-
- var Repo = imports.Scm.Repo.Repo;
- var t = this;
- imports.Tasks.Tasks.list(Repo.get('gitlive'), function(res) {
- t.loadData(res);
- });
-
-
- },
- loadData : function (data) {
-
- var iter = new Gtk.TreeIter();
- var el = this.el;
- data.forEach(function(p) {
-
- el.append(iter);
-
-
- el.set_value(iter, 0, p.id);
- el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );
-
- });
-
-
- }
- },
- {
- xtype: Gtk.TreeViewColumn,
- pack : "append_column",
- init : function() {
- XObject.prototype.init.call(this);
- this.el.add_attribute(this.items[0].el , 'markup', 0 );
- },
- items : [
- {
- xtype: Gtk.CellRendererText,
- pack : "pack_start"
- }
- ]
- }
- ]
- }
- ]
}
]
}