conf7819.file
[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    "listeners" : {
11     "size_allocate" : "(aloc) => {\n\n    this.width = aloc.width;\n    this.height =aloc.height;\n    }\n"
12    },
13    "id" : "GtkView",
14    "| 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",
15    "# Gtk.Widget lastObj" : "null",
16    "| void loadFile" : "(JsRender.JsRender file) \n{\n    \n       // this.el.set_position((int)(this.el.max_position * 0.7));\n        this.el.set_position(this.el.max_position );\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          \n        \n        var w = this.width;\n        var h = this.height;\n        \n        print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = int.max (w-20, 500);\n        h = int.max (h-20, 500); \n        \n        print(\"SET SIZES %d, %d\\n\", w,h);       \n        _this.container.el.set_size_request(w,h);\n        \n        _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n        var rgba = Gdk.RGBA ();\n        rgba.parse (\"#ccc\");\n        _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n        \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 ",
17    "int width" : 0,
18    "xtype" : "VPaned",
19    "# JsRender.JsRender file" : "null",
20    "int height" : 0,
21    "$ xns" : "Gtk",
22    "items" : [
23     {
24      "* pack" : "pack1,true,true",
25      "xtype" : "ScrolledWindow",
26      "$ xns" : "Gtk",
27      "items" : [
28       {
29        "id" : "view_layout",
30        "xtype" : "Layout",
31        "* pack" : "add",
32        "$ xns" : "Gtk",
33        "items" : [
34         {
35          "id" : "container",
36          "* pack" : "put,10,10",
37          "xtype" : "HBox",
38          "$ xns" : "Gtk"
39         }
40        ]
41       }
42      ]
43     },
44     {
45      "id" : "compile_view",
46      "xtype" : "VBox",
47      "* pack" : "pack2,true,true",
48      "gboolean homogeneous" : false,
49      "$ xns" : "Gtk",
50      "items" : [
51       {
52        "xtype" : "HBox",
53        "* pack" : "pack_start,false,false,0",
54        "$ xns" : "Gtk",
55        "items" : [
56         {
57          "* pack" : "pack_start,true,true,0",
58          "xtype" : "Button",
59          "$ xns" : "Gtk",
60          "utf8 label" : "Full Compile"
61         }
62        ]
63       },
64       {
65        "* pack" : "pack_start,true,true,0",
66        "xtype" : "HBox",
67        "gboolean homogeneous" : true,
68        "$ xns" : "Gtk",
69        "items" : [
70         {
71          "* pack" : "add",
72          "xtype" : "TreeView",
73          "$ xns" : "Gtk",
74          "items" : [
75           {
76            "gint n_columns" : 1,
77            "columns" : "  typeof(string)",
78            "* pack" : "set_model",
79            "xtype" : "ListStore",
80            "$ xns" : "Gtk"
81           },
82           {
83            "utf8 title" : "Compile output",
84            "xtype" : "TreeViewColumn",
85            "string id" : "column",
86            "$ xns" : "Gtk",
87            "items" : [
88             {
89              "* pack" : "pack_start,false",
90              "xtype" : "CellRendererText",
91              "$ xns" : "Gtk"
92             }
93            ]
94           }
95          ]
96         },
97         {
98          "* pack" : "pack_start,true,true,0",
99          "xtype" : "ScrolledWindow",
100          "$ xns" : "Gtk",
101          "items" : [
102           {
103            "gboolean show_line_marks" : true,
104            "xtype" : "View",
105            "* pack" : "add",
106            "$ xns" : "GtkSource",
107            "gboolean show_line_numbers" : true,
108            "gboolean editable" : false
109           }
110          ]
111         }
112        ]
113       }
114      ]
115     }
116    ]
117   }
118  ]
119 }