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