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.VBox,
49             items : [
50                 {
51                     xtype: Gtk.HBox,
52                     items : [
53                         {
54                             xtype: Gtk.Button,
55                             label : "Reset"
56                         }
57                     ]
58                 },
59                 {
60                     xtype: Gtk.HBox,
61                     items : [
62                         {
63                             xtype: Gtk.ScrolledWindow,
64                             items : [
65                                 {
66                                     xtype: Gtk.TreeView,
67                                     items : [
68                                         {
69                                             xtype: Gtk.ListStore,
70                                             id : "class-list-store"
71                                         },
72                                         {
73                                             xtype: Gtk.TreeViewColumn,
74                                             title : "Class",
75                                             items : [
76                                                 {
77                                                     xtype: Gtk.CellRendererText
78                                                 }
79                                             ]
80                                         }
81                                     ]
82                                 }
83                             ]
84                         },
85                         {
86                             xtype: Gtk.ScrolledWindow,
87                             items : [
88                                 {
89                                     xtype: Gtk.TreeView,
90                                     items : [
91                                         {
92                                             xtype: Gtk.ListStore,
93                                             id : "method-list-store"
94                                         },
95                                         {
96                                             xtype: Gtk.TreeViewColumn,
97                                             title : "Methods",
98                                             items : [
99                                                 {
100                                                     xtype: Gtk.CellRendererText
101                                                 }
102                                             ]
103                                         }
104                                     ]
105                                 }
106                             ]
107                         },
108                         {
109                             xtype: Gtk.ScrolledWindow,
110                             items : [
111                                 {
112                                     xtype: Gtk.TreeView,
113                                     items : [
114                                         {
115                                             xtype: Gtk.ListStore,
116                                             id : "children-list-store"
117                                         },
118                                         {
119                                             xtype: Gtk.TreeViewColumn,
120                                             title : "Child classes",
121                                             items : [
122                                                 {
123                                                     xtype: Gtk.CellRendererText
124                                                 }
125                                             ]
126                                         }
127                                     ]
128                                 }
129                             ]
130                         }
131                     ]
132                 }
133             ]
134         }
135     ]
136 });
137 Window.init();
138 XObject.cache['/Window'] = Window;