XObjectBase/GtkScrolledWindow.js
[app.Builder.js] / XObjectBase / GtkClutterEmbed.js
1 //<Script type="Text/javascript">
2
3 XObject = imports.XObject.XObject
4 GtkClutter = imports.gi.GtkClutter;
5
6 //GtkClutter.Embed..
7 // children are not added at init / but at show stage..
8 // listener is added on show..
9 // we should really add a hock to destroy it..
10
11 GtkClutterEmbed = {
12     onConstruct :  function (x)
13     {
14         // make sure all the child elements are packed as false.
15         this.items.forEach( function(i) {
16             i.pack = false;
17         });
18                
19     },
20     
21     init : function() {
22         // add the event listener..
23         
24         XObject.prototype.init.call(this);
25         
26         print("----------Embed init");
27         this.addListener('show', function () {
28             print("-------EMBED - show");
29             var stage = this.el.get_stage(); 
30             //print(this.items.length);
31             this.items.forEach( function(e) { 
32                   //print(e.xtype);
33                 stage.add_actor(e.el);
34             });
35         });
36        
37        
38     }
39
40 };