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         this.items[0].pack = false;
16         
17     },
18     
19     init : function() {
20         print ("Actor init");
21         if (!child.items.length) {
22             print ("Actor does not have any children");
23             return;
24         }
25         var child = this.items[0];
26         child.init();
27         
28         child.parent = this;
29         //var contents = new Gtk.Button({ label: 'test' }); 
30         
31        // print(JSON.stringify(this.items));
32         child.el.show();
33         
34         this.el = new GtkClutter.Actor.with_contents (  child.el) ;
35         
36         XObject.prototype.init.call(this);
37         this.el.show_all();
38     }
39
40 };