2 //<Script type="Text/javascript">
4 XObject = imports.XObject.XObject
5 GtkClutter = imports.gi.GtkClutter;
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..
13 GtkClutterActor = XObject.define(
15 XObject.call(this, cfg);
16 if (!this.items.length) {
17 XObject.fatal("Actor does not have any children");
21 this.items[0].pack = false;
26 pack : function(parent, item)
29 if (XObject.type(parent.xtype) == 'GtkClutterWindow') {
30 var st = parent.el.get_stage();
31 st.add_actor(this.el);
34 XObject.fatal("do not know how to pack actor into " + XObject.type(parent.xtype));
42 if (!this.items.length) {
43 print ("Actor does not have any children");
46 var child = this.items[0];
50 //var contents = new Gtk.Button({ label: 'test' });
52 // print(JSON.stringify(this.items));
55 this.el = new GtkClutter.Actor.with_contents ( child.el) ;
57 XObject.prototype.init.call(this);