ClutterTest
[app.Builder.js] / ClutterTest / Window.bjs
1 {
2     "id": "file-gtk-11",
3     "name": "Window",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/cluttertest/Window.bjs",
7     "items": [
8         {
9             "default_height": 600,
10             "default_width": 600,
11             "xtype": "Window",
12             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.show_all();\n}\n",
13             "|xns": "Gtk",
14             "items": [
15                 {
16                     "listeners": {
17                         "show": "function() { \n   var stage = this.el.get_stage(); \n   print(this.items.length);\n   this.items.forEach( \n      function(e) { \n          print(e.xtype);\n          stage.add_actor(e.el);\n        }\n     );\n}"
18                     },
19                     "pack": "add",
20                     "xtype": "Embed",
21                     "|xns": "GtkClutter",
22                     "items": [
23                         {
24                             "pack": false,
25                             "x": 100,
26                             "xtype": "Actor",
27                             "y": 100,
28                             "|init": "function() {\n\n    var child = new XObject(this.items[0]);\n    child.init();\n    child.parent = this;\n    //var contents = new Gtk.Button({ label: 'test' }); \n    var contents = child.el;\n   \n    print(JSON.stringify(this.items));\n    \n    \n    this.el = new GtkClutter.Actor.with_contents (  contents) ;\n    XObject.prototype.init.call(this);\n}\n",
29                             "|xns": "GtkClutter",
30                             "items": [
31                                 {
32                                     "listeners": {
33                                         "clicked": "function (self) {\n   Clutter = imports.gi.Clutter;\n        var animate = this.parent.el.animate(\n\t\tClutter.AnimationMode.EASE_OUT_ELASTIC, 2000,\n\t\t{\n\t\t\t   scale_x : 5,\n\t\t\t  scale_y: 5,\n\n\t\t}\n\t\t);\n\t\tanimate.timeline.start();\n\n}"
34                                     },
35                                     "height_request": 100,
36                                     "label": "test",
37                                     "pack": false,
38                                     "width_request": 100,
39                                     "xtype": "Button",
40                                     "|xns": "Gtk"
41                                 }
42                             ]
43                         },
44                         {
45                             "pack": false,
46                             "x": 300,
47                             "xtype": "Actor",
48                             "y": 100,
49                             "|init": "function() {\n\n    var child = new XObject(this.items[0]);\n    child.init();\n    child.parent = this;\n    //var contents = new Gtk.Button({ label: 'test' }); \n    var contents = child.el;\n    print (\"actor.items\");\n    print(JSON.stringify(this.items));\n    \n    \n    this.el = new GtkClutter.Actor.with_contents (  contents) ;\n    XObject.prototype.init.call(this);\n}\n",
50                             "|xns": "GtkClutter",
51                             "items": [
52                                 {
53                                     "listeners": {
54                                         "clicked": "function (self) {\n   Clutter = imports.gi.Clutter;\n        var animate = this.parent.el.animate(\n\t\tClutter.AnimationMode.EASE_OUT_ELASTIC, 2000,\n\t\t{\n\t\t\t   scale_x : 5,\n\t\t\t  scale_y: 5,\n\n\t\t}\n\t\t);\n\t\tanimate.timeline.start();\n\n}"
55                                     },
56                                     "height_request": 100,
57                                     "label": "test",
58                                     "pack": false,
59                                     "width_request": 100,
60                                     "xtype": "Button",
61                                     "|xns": "Gtk"
62                                 }
63                             ]
64                         }
65                     ]
66                 }
67             ]
68         }
69     ]
70 }