src/Builder4/GtkView.bjs
[app.Builder.js] / src / Builder4 / GtkView.bjs
1 {
2  "name" : "GtkView",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/GtkView.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "items" : [
9   {
10    "id" : "GtkView",
11    "# Gtk.Widget lastObj" : "null",
12    "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n    var height = win.get_height();\n\n    Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n\n    screenshot.save(filename,\"png\");\n    return;\n    \n    \n    \n    \n    \n     \n    \n    // should we hold until it's printed...\n    \n      \n\n    \n    \n\n\n    \n     \n}\n",
13    "| void loadFile" : "(JsRender.JsRender file) \n{\n    \n        this.el.set_position((int)(this.el.max_position * 0.7));\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n        this.file = file;\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n        _this.compile_button.el.hide();\n         _this.compile_view.el.hide();\n         \n        \n        uint w,h;\n        \n        _this.view_layout.el.get_size(out w, out h);\n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = uint.min (w-20, 500);\n        h = uint.min (h-20, 500);        \n        _this.container.el.set_size_request((int)w,(int)h);\n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         \n        \n}\n ",
14    "xtype" : "VPaned",
15    "# JsRender.JsRender file" : "null",
16    "$ xns" : "Gtk",
17    "items" : [
18     {
19      "id" : "view_layout",
20      "* pack" : "pack1,true,true",
21      "xtype" : "Layout",
22      "$ xns" : "Gtk",
23      "items" : [
24       {
25        "id" : "container",
26        "* pack" : "put,10,10",
27        "xtype" : "HBox",
28        "$ xns" : "Gtk"
29       }
30      ]
31     },
32     {
33      "* pack" : "pack2,true,true",
34      "xtype" : "VBox",
35      "gboolean homogeneous" : false,
36      "$ xns" : "Gtk",
37      "items" : [
38       {
39        "xtype" : "HBox",
40        "* pack" : "pack_start,false,false,0",
41        "$ xns" : "Gtk",
42        "items" : [
43         {
44          "* pack" : "pack_start,true,true,0",
45          "xtype" : "Button",
46          "$ xns" : "Gtk",
47          "utf8 label" : "Full Compile"
48         }
49        ]
50       },
51       {
52        "id" : "compile_view",
53        "* pack" : "pack_start,true,true,0",
54        "xtype" : "HBox",
55        "gboolean homogeneous" : true,
56        "$ xns" : "Gtk",
57        "items" : [
58         {
59          "* pack" : "add",
60          "xtype" : "TreeView",
61          "$ xns" : "Gtk",
62          "items" : [
63           {
64            "gint n_columns" : 1,
65            "columns" : "  typeof(string)",
66            "* pack" : "set_model",
67            "xtype" : "ListStore",
68            "$ xns" : "Gtk"
69           },
70           {
71            "utf8 title" : "Compile output",
72            "xtype" : "TreeViewColumn",
73            "string id" : "column",
74            "$ xns" : "Gtk",
75            "items" : [
76             {
77              "* pack" : "pack_start,false",
78              "xtype" : "CellRendererText",
79              "$ xns" : "Gtk"
80             }
81            ]
82           }
83          ]
84         },
85         {
86          "* pack" : "pack_start,true,true,0",
87          "xtype" : "ScrolledWindow",
88          "$ xns" : "Gtk",
89          "items" : [
90           {
91            "gboolean show_line_marks" : true,
92            "* pack" : "add",
93            "xtype" : "View",
94            "$ xns" : "GtkSource",
95            "gboolean show_line_numbers" : true,
96            "gboolean editable" : false
97           }
98          ]
99         }
100        ]
101       }
102      ]
103     }
104    ]
105   }
106  ]
107 }