ClutterTest/Window.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 22 Jun 2010 11:16:39 +0000 (19:16 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 22 Jun 2010 11:16:39 +0000 (19:16 +0800)
ClutterTest/Window.js

index 820f409..3f7f395 100644 (file)
@@ -95,6 +95,50 @@ Window=new XObject({
                         print(JSON.stringify(this.items));
                         
                         
+                        this.el = new GtkClutter.Actor.with_contents (  contents) ;
+                        XObject.prototype.init.call(this);
+                    },
+                    items : [
+                        {
+                            xtype: Gtk.Button,
+                            listeners : {
+                                clicked : function (self) {
+                                   Clutter = imports.gi.Clutter;
+                                        var animate = this.parent.el.animate(
+                                               Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
+                                               {
+                                                          scale_x : 5,
+                                                         scale_y: 5,
+                                
+                                               }
+                                               );
+                                               animate.timeline.start();
+                                
+                                }
+                            },
+                            height_request : 100,
+                            label : "test",
+                            pack : false,
+                            width_request : 100
+                        }
+                    ]
+                },
+                {
+                    xtype: GtkClutter.Actor,
+                    pack : false,
+                    x : 100,
+                    y : 300,
+                    init : function() {
+                    
+                        var child = new XObject(this.items[0]);
+                        child.init();
+                        child.parent = this;
+                        //var contents = new Gtk.Button({ label: 'test' }); 
+                        var contents = child.el;
+                       
+                        print(JSON.stringify(this.items));
+                        
+                        
                         this.el = new GtkClutter.Actor.with_contents (  contents) ;
                         XObject.prototype.init.call(this);
                     },