src/Builder4/ValaCompileErrors.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 18 May 2015 08:12:24 +0000 (16:12 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 18 May 2015 08:12:24 +0000 (16:12 +0800)
src/Builder4/ValaCompileErrors.vala

src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala

index 2aca8cd..6426506 100644 (file)
@@ -11,7 +11,7 @@
    "int height_request" : 800,
    "id" : "ValaCompileErrors",
    "Xcls_MainWindow window" : "",
-   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        this.notices = tree;\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    this.hpane.el.set_position(250);\n   if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n          \n\n}\n",
+   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        this.notices = tree;\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    int w,h;\n    this.window.get_size(out w, out h);\n    this.el.width_request = int.max(100, w);\n    this.el.height_request = int.max(100, h);\n    \n    this.hpane.el.set_position(250);\n   if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n          \n\n}\n",
    "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
    "int width_request" : 900,
@@ -21,8 +21,8 @@
    "items" : [
     {
      "id" : "compile_view",
-     "xtype" : "VBox",
      "* pack" : "add",
+     "xtype" : "VBox",
      "gboolean homogeneous" : false,
      "$ xns" : "Gtk",
      "items" : [
       },
       {
        "id" : "hpane",
-       "xtype" : "HPaned",
        "* pack" : "pack_start,true,true,0",
+       "xtype" : "HPaned",
        "$ xns" : "Gtk",
        "items" : [
         {
          "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
-         "* pack" : "add",
          "xtype" : "ScrolledWindow",
+         "* pack" : "add",
          "$ xns" : "Gtk",
          "items" : [
           {
@@ -79,8 +79,8 @@
              "items" : [
               {
                "id" : "renderer",
-               "xtype" : "CellRendererText",
                "* pack" : "pack_start,true",
+               "xtype" : "CellRendererText",
                "$ xns" : "Gtk"
               }
              ]
index aef25e0..34b6f28 100644 (file)
@@ -86,8 +86,11 @@ public class Xcls_ValaCompileErrors : Object
                 
             
             });
-               
-     
+            
+        int w,h;
+        this.window.get_size(out w, out h);
+        this.el.width_request = int.max(100, w);
+        this.el.height_request = int.max(100, h);
         
         this.hpane.el.set_position(250);
        if (this.el.relative_to == null) {