XObjectBase/GtkClutterActor.js
[app.Builder.js] / XObjectBase / GtkClutterActor.js
1
2 //<Script type="Text/javascript">
3
4 XObject = imports.XObject.XObject
5 GtkClutter = imports.gi.GtkClutter;
6
7 //GtkClutter.Embed..
8 // children are not added at init / but at show stage..
9 // listener is added on show..
10 // we should really add a hock to destroy it..
11
12 GtkClutterActor = {
13     
14     onConstruct : function() {
15         if (!child.items.length) {
16             print ("Actor does not have any children");
17             return;
18         }
19         this.items[0].pack = false;
20         
21     },
22     
23     init : function() {
24         print ("Actor init");
25         if (!child.items.length) {
26             print ("Actor does not have any children");
27             return;
28         }
29         var child = this.items[0];
30         child.init();
31         
32         child.parent = this;
33         //var contents = new Gtk.Button({ label: 'test' }); 
34         
35        // print(JSON.stringify(this.items));
36         child.el.show();
37         
38         this.el = new GtkClutter.Actor.with_contents (  child.el) ;
39         
40         XObject.prototype.init.call(this);
41         this.el.show_all();
42     }
43
44 };