src/Builder4/ValaCompileErrors.bjs
[app.Builder.js] / src / Builder4 / ValaCompileErrors.bjs
1 {
2  "name" : "ValaCompileErrors",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/ValaCompileErrors.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "int height_request" : 600,
12    "id" : "ValaCompileErrors",
13    "Xcls_MainWindow window" : "",
14    "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n    while (Gtk.events_pending()) {\n        Gtk.main_iteration();\n    }\n\n    this.hpane.el.set_position(200);\n    this.el.set_relative_to(onbtn);\n        this.el.show_all();\n        \n         //print(\"looking for %s\\n\", id);\n        // loop through parent childnre\n          \n        \n        var store = this.compile_result_store.el;    \n        \n        store.clear();\n     \n        \n        tree.foreach_member((obj, file, node) => {\n            // id line \"display text\", file\n            \n            var title = GLib.Path.get_basename( file) ;\n            Gtk.TreeIter iter;\n            print(\"Add file %s\", title);\n            store.append(out iter, null);\n            var lines = tree.get_object_member(file);\n            title += \" (\" + lines.get_size().to_string() + \")\";\n            store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);\n            \n            lines.foreach_member((obja, line, nodea) => {\n                var msg  = \"\";\n                var ar = lines.get_array_member(line);\n                for (var i = 0 ; i < ar.get_length(); i++) {\n    \t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n    \t\t    msg += ar.get_string_element(i);\n\t        }\n                Gtk.TreeIter citer;  \n                print(\"Add line %s\", line);\n                store.append(out citer, iter);\n                store.set(citer, \n                    0, file + \":\" + line, \n                    1, int.parse(line), \n                    2, GLib.Markup.escape_text(line + \": \" + msg), \n                    3, file,-1);\n            \n            });\n            \n            \n        \n        });     \n             \n\n}\n",
15    "xtype" : "Popover",
16    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
17    "int width_request" : 600,
18    "$ xns" : "Gtk",
19    "items" : [
20     {
21      "id" : "compile_view",
22      "* pack" : "add",
23      "xtype" : "VBox",
24      "gboolean homogeneous" : false,
25      "$ xns" : "Gtk",
26      "items" : [
27       {
28        "xtype" : "HBox",
29        "* pack" : "pack_start,false,false,0",
30        "$ xns" : "Gtk",
31        "items" : [
32         {
33          "* pack" : "pack_start,true,true,0",
34          "xtype" : "Button",
35          "$ xns" : "Gtk",
36          "utf8 label" : "Compile and Run"
37         }
38        ]
39       },
40       {
41        "id" : "hpane",
42        "* pack" : "pack_start,true,true,0",
43        "xtype" : "HPaned",
44        "$ xns" : "Gtk",
45        "items" : [
46         {
47          "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
48          "xtype" : "ScrolledWindow",
49          "* pack" : "add",
50          "$ xns" : "Gtk",
51          "items" : [
52           {
53            "id" : "compile_tree",
54            "xtype" : "TreeView",
55            "* pack" : "add",
56            "$ xns" : "Gtk",
57            "items" : [
58             {
59              "gint n_columns" : 4,
60              "id" : "compile_result_store",
61              "columns" : "  typeof(string), typeof(int), typeof(string), typeof(string) ",
62              "* pack" : "set_model",
63              "xtype" : "TreeStore",
64              "$ xns" : "Gtk"
65             },
66             {
67              "utf8 title" : "Compile output",
68              "* init" : "{\n  this.el.add_attribute(_this.renderer.el , \"markup\", 2 );\n \n}\n",
69              "xtype" : "TreeViewColumn",
70              "* pack" : "append_column",
71              "string id" : "column",
72              "$ xns" : "Gtk",
73              "items" : [
74               {
75                "id" : "renderer",
76                "* pack" : "pack_start,true",
77                "xtype" : "CellRendererText",
78                "$ xns" : "Gtk"
79               }
80              ]
81             }
82            ]
83           }
84          ]
85         },
86         {
87          "* pack" : "add",
88          "xtype" : "ScrolledWindow",
89          "$ xns" : "Gtk",
90          "items" : [
91           {
92            "gboolean show_line_marks" : true,
93            "* pack" : "add",
94            "xtype" : "SourceView",
95            "$ xns" : "Gtk",
96            "gboolean show_line_numbers" : true,
97            "gboolean editable" : false
98           }
99          ]
100         }
101        ]
102       }
103      ]
104     }
105    ]
106   }
107  ]
108 }