DependTree/Window.js
[app.Builder.js] / DependTree / Window.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 GtkClutter = imports.gi.GtkClutter;
11 Gdl = imports.gi.Gdl;
12 console = imports.console;
13 XObject = imports.XObject.XObject;
14 Window=new XObject({
15     xtype: Gtk.Window,
16     listeners : {
17         show : function (self) {
18             print("SHOW");
19             var BuildLists = imports['BuildLists.js'].BuildLists;
20             this.data = new BuildLists();
21             print(JSON.stringify(this.data.allmethods, null,4));
22             
23             var ls = this.get('method-list-store');
24             this.data.allmethods.forEach(function(v) {
25                 ls.append( [ v ]);
26             });
27             var ls = this.get('children-list-store');
28             this.data.allchildren.forEach(function(v) {
29                 ls.append( [ v ]);
30             });
31             var ls = this.get('class-list-store');
32             for (var c in this.data.methods) {
33                 ls.append( [ c ]);
34             };
35             
36             
37             
38         }
39     },
40     default_height : 500,
41     default_width : 600,
42     init : function() {
43         XObject.prototype.init.call(this);
44         this.el.show_all();
45     },
46     items : [
47         {
48             xtype: Gtk.HBox,
49             items : [
50                 {
51                     xtype: Gtk.ScrolledWindow,
52                     items : [
53                         {
54                             xtype: Gtk.TreeView,
55                             items : [
56                                 {
57                                     xtype: Gtk.ListStore,
58                                     id : "class-list-store"
59                                 },
60                                 {
61                                     xtype: Gtk.TreeViewColumn,
62                                     title : "Class",
63                                     items : [
64                                         {
65                                             xtype: Gtk.CellRendererText
66                                         }
67                                     ]
68                                 }
69                             ]
70                         }
71                     ]
72                 },
73                 {
74                     xtype: Gtk.ScrolledWindow,
75                     items : [
76                         {
77                             xtype: Gtk.TreeView,
78                             items : [
79                                 {
80                                     xtype: Gtk.ListStore,
81                                     id : "method-list-store"
82                                 },
83                                 {
84                                     xtype: Gtk.TreeViewColumn,
85                                     title : "Child Classes",
86                                     items : [
87                                         {
88                                             xtype: Gtk.CellRendererText
89                                         }
90                                     ]
91                                 }
92                             ]
93                         }
94                     ]
95                 },
96                 {
97                     xtype: Gtk.ScrolledWindow,
98                     items : [
99                         {
100                             xtype: Gtk.TreeView,
101                             items : [
102                                 {
103                                     xtype: Gtk.ListStore,
104                                     id : "children-list-store"
105                                 },
106                                 {
107                                     xtype: Gtk.TreeViewColumn,
108                                     title : "Methods",
109                                     items : [
110                                         {
111                                             xtype: Gtk.CellRendererText
112                                         }
113                                     ]
114                                 }
115                             ]
116                         }
117                     ]
118                 }
119             ]
120         }
121     ]
122 });
123 Window.init();
124 XObject.cache['/Window'] = Window;