8e5cbcfc7d83737a56e2da538f350a8f85bb90c1
[app.Builder.js] / Builder3 / Main.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3
4 Window = imports.Builder3.Window.Window;
5
6 JSON.x = function (o) {
7           var seen = [];
8           return JSON.(o, function(_, value) {
9                   if (typeof value === 'object' && value !== null) {
10                           if (seen.indexOf(value) !== -1) return null;
11                           else seen.push(value);
12                   }
13                   return value;
14           }, 4);
15 }
16
17 /*
18 atoms = {
19                "STRING" : Gdk.atom_intern("STRING")
20         };
21 targetList = new Gtk.TargetList();
22 targetList.add(  atoms["STRING"], 0, 0);
23
24
25
26 Gtk.rc_parse_string(
27             "style \"gtkcombobox-style\" {\n" + 
28             "    GtkComboBox::appears-as-list = 1\n" +
29             "}\n"+
30             "class \"GtkComboBox\" style \"gtkcombobox-style\"\n");
31
32 */
33 Window.el.show_all();
34
35
36 // this ties two elements together...
37 // it used to hapen in the init() code for the element, it should be moved to a 'global init for a whole module'
38 var pm = imports.ProjectManager.ProjectManager;
39
40 var combomodel =  Window.get('/LeftProjectTree.combomodel');
41 pm.on('changed', function() {
42       print("caught changed hook on project manager - reloading data");
43      combomodel.loadData(pm.projects);
44
45 });
46