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

index 3f7f395..7a54c02 100644 (file)
@@ -12,8 +12,8 @@ console = imports.console;
 XObject = imports.XObject.XObject;
 Window=new XObject({
     xtype: Gtk.Window,
-    default_height : 600,
-    default_width : 600,
+    default_height : 900,
+    default_width : 900,
     init : function() {
         XObject.prototype.init.call(this);
         this.el.show_all();
@@ -38,8 +38,8 @@ Window=new XObject({
                 {
                     xtype: GtkClutter.Actor,
                     pack : false,
-                    x : 100,
-                    y : 100,
+                    x : 10,
+                    y : 10,
                     init : function() {
                     
                         var child = new XObject(this.items[0]);
@@ -73,7 +73,7 @@ Window=new XObject({
                                 }
                             },
                             height_request : 100,
-                            label : "test",
+                            label : "project list",
                             pack : false,
                             width_request : 100
                         }
@@ -82,8 +82,8 @@ Window=new XObject({
                 {
                     xtype: GtkClutter.Actor,
                     pack : false,
-                    x : 300,
-                    y : 100,
+                    x : 10,
+                    y : 150,
                     init : function() {
                     
                         var child = new XObject(this.items[0]);
@@ -117,7 +117,183 @@ Window=new XObject({
                                 }
                             },
                             height_request : 100,
-                            label : "test",
+                            label : "file list",
+                            pack : false,
+                            width_request : 100
+                        }
+                    ]
+                },
+                {
+                    xtype: GtkClutter.Actor,
+                    pack : false,
+                    x : 10,
+                    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);
+                    },
+                    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 : "tree of parts",
+                            pack : false,
+                            width_request : 100
+                        }
+                    ]
+                },
+                {
+                    xtype: GtkClutter.Actor,
+                    pack : false,
+                    x : 10,
+                    y : 450,
+                    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);
+                    },
+                    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 : "property editor",
+                            pack : false,
+                            width_request : 100
+                        }
+                    ]
+                },
+                {
+                    xtype: GtkClutter.Actor,
+                    pack : false,
+                    x : 150,
+                    y : 450,
+                    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);
+                    },
+                    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 : "text editor",
+                            pack : false,
+                            width_request : 100
+                        }
+                    ]
+                },
+                {
+                    xtype: GtkClutter.Actor,
+                    pack : false,
+                    x : 150,
+                    y : 10,
+                    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);
+                    },
+                    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 : "preview app",
                             pack : false,
                             width_request : 100
                         }
@@ -161,7 +337,7 @@ Window=new XObject({
                                 }
                             },
                             height_request : 100,
-                            label : "test",
+                            label : "palete",
                             pack : false,
                             width_request : 100
                         }