fix line numbering issues with vala generator - hopefully fixes completion in node...
[roobuilder] / src / Builder4 / MainWindow.bjs
index f57fb67..d43dd8f 100644 (file)
 {
- "name" : "MainWindow",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",
- "permname" : "",
- "modOrder" : "",
  "build_module" : "builder",
+ "gen_extended" : false,
  "items" : [
   {
-   "listeners" : {
-    "delete_event" : "  (   event) => {\n    return false;\n} ",
-    "destroy" : "() =>  {\n Xcls_MainWindow.singleton().no_windows--;\n \n Resources.singleton().disconnect(_this.statusbar.handler_id);\n \n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n     Gtk.main_quit();\n }\n}",
-    "show" : "  ( ) => {\n    // hide the file editing..\n   \n    //this.hideViewEditing();\n    _this.statusbar.el.hide();\n     _this.statusbar_errors.el.hide();\n    _this.statusbar_warnings.el.hide();\n    _this.statusbar_depricated.el.hide();\n    _this.statusbar_compile_spinner.el.hide();\n  \n    Resources.singleton().checkResources();\n\n}",
-    "key_release_event" : " (event) => {\n    \n    if (this.search_entry.el.is_visible()) {\n\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-f  pressed\");\n\t\t\tthis.search_entry.el.grab_focus();\n\t\t    return false;\n\t\t}\n\t\t\n\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-g  pressed\");\n\t\t\tthis.search_entry.forwardSearch(true);\n\t\t    return false;\n\t\t}\n\t\t\n\t}    \n\t\n\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\tprint(\"SAVE: ctrl-n  pressed\");\n\t\tthis.openNewWindow();\n\t\treturn false;\n\t}\n\t\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
-   },
-   "id" : "MainWindow",
-   "default_width" : 800,
-   "* init" : " \n\t  \n    //this.el.show_all();\n    //try {\n         this.el.set_icon_name(\"roobuilder\");\n\t//} catch (Exception e) {\n\t//\tprint(\"no icon found\");\n//\t}",
-   "| void openNewWindow" : "() {\n\tXcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}\n",
    "# Project.Project project" : "null",
-   "# string title" : "\"Roo Application Builder\"",
-   "xtype" : "Window",
-   "# int no_windows" : 1,
-   "default_height" : 500,
-   "|        void initChildren" : " () {\n    // this needs putting in a better place..\n    this.windowstate = new WindowState(this);\n     \n\n    //w.el.show_all();\n    var tl = new Clutter.Timeline(6000);\n    tl.set_repeat_count(-1);\n    tl.start();\n    tl.ref();\n\n    \n\n\n\n}\n",
+   "# WindowState windowstate" : "",
+   "$ type" : "Gtk.WindowType.TOPLEVEL",
    "$ xns" : "Gtk",
-   "|             void show" : "() {\n   \n    this.el.show_all();\n\n}",
-   "# WindowState windowstate" : "null",
+   "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
+   "* init" : [
+    " ",
+    " ",
+    "     this.el.set_icon_name(\"roobuilder\");",
+    "     ",
+    "   ",
+    "     ",
+    " "
+   ],
    "border_width" : 0,
-   "$ type" : "Gtk.WindowType.TOPLEVEL",
-   "|             void setTitle" : " (string str) {\n    this.headerbar.el.set_title(this.title + \" - \" + str);\n} \n",
+   "default_height" : 850,
+   "default_width" : 1200,
+   "id" : "MainWindow",
    "items" : [
     {
-     "id" : "headerbar",
+     "$ string title" : "\"Application Builder\"",
+     "$ xns" : "Gtk",
      "* pack" : "set_titlebar",
-     "xtype" : "HeaderBar",
      "bool show_close_button" : true,
-     "$ xns" : "Gtk",
-     "string title" : "Application Builder",
+     "id" : "headerbar",
      "items" : [
       {
-       "* pack" : "pack_start",
-       "xtype" : "Box",
        "$ xns" : "Gtk",
+       "* pack" : "pack_start",
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
-         "bool use_popover" : false,
-         "* pack" : "add",
-         "xtype" : "MenuButton",
+         "# Gee.ArrayList<Gtk.Widget> mitems" : "",
+         "$ Gtk.Align halign" : "Gtk.Align.START",
          "$ xns" : "Gtk",
+         "* init" : [
+          "{",
+          "\tthis.mitems = new Gee.ArrayList<Gtk.Button>();",
+          "}",
+          ""
+         ],
+         "id" : "windowbtn",
+         "int margin_end" : 4,
          "items" : [
           {
-           "id" : "topbarmenu",
-           "* init" : "{\n    this.el.show_all();\n}\n",
-           "xtype" : "Menu",
-           "* pack" : "set_popup",
            "$ xns" : "Gtk",
+           "* pack" : false,
+           "id" : "windowspopup",
            "items" : [
             {
-             "listeners" : {
-              "activate" : "( ) => {\n       _this.openNewWindow();\n}"
-             },
-             "xtype" : "MenuItem",
-             "string label" : "Open a new Window",
-             "* pack" : "append",
-             "$ xns" : "Gtk"
-            },
-            {
-             "* pack" : "append",
-             "xtype" : "SeparatorMenuItem",
-             "$ xns" : "Gtk"
-            },
+             "$ xns" : "Gtk",
+             "* pack" : "set_child",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+             "id" : "popover_menu",
+             "int spacing" : 0,
+             "items" : [
+              {
+               "$ xns" : "Gtk",
+               "* pack" : "append",
+               "items" : [
+                {
+                 "$ Gtk.ShortcutScope scope" : "Gtk.ShortcutScope.GLOBAL",
+                 "$ xns" : "Gtk",
+                 "* init" : [
+                  "{",
+                  "\tthis.el.add_shortcut(",
+                  "\t\tnew Gtk.Shortcut(",
+                  "\t\t\tnew Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),",
+                  "\t\t\tnew Gtk.SignalAction(\"clicked\")",
+                  "\t\t)",
+                  "\t);",
+                  "}",
+                  ""
+                 ],
+                 "xtype" : "ShortcutController"
+                }
+               ],
+               "listeners" : {
+                "clicked" : [
+                 "( ) => {",
+                 "\t_this.windowspopup.el.hide();",
+                 "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
+                 "}",
+                 ""
+                ]
+               },
+               "string label" : "New Window",
+               "xtype" : "Button"
+              },
+              {
+               "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+               "$ xns" : "Gtk",
+               "* pack" : "append",
+               "xtype" : "Separator"
+              }
+             ],
+             "xtype" : "Box"
+            }
+           ],
+           "xtype" : "Popover"
+          },
+          {
+           "$ xns" : "Gtk",
+           "* prop" : "child",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+           "items" : [
             {
-             "listeners" : {
-              "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
-             },
-             "* pack" : "append",
-             "xtype" : "MenuItem",
-             "string label" : "Download updated Resources",
-             "$ xns" : "Gtk"
+             "$ xns" : "Gtk",
+             "int margin_start" : 4,
+             "string icon_name" : "window-new",
+             "xtype" : "Image"
             },
             {
-             "listeners" : {
-              "activate" : "() => {\n    About.singleton().el.show();\n    }"
-             },
-             "string label" : "About the Builder",
-             "* pack" : "append",
-             "xtype" : "MenuItem",
-             "$ xns" : "Gtk"
+             "$ xns" : "Gtk",
+             "string label" : "Windows (Add/List)",
+             "xtype" : "Label"
             }
-           ]
-          },
-          {
-           "xtype" : "Image",
-           "utf8 icon_name" : "help-about",
-           "* pack" : "set_image",
-           "$ xns" : "Gtk"
+           ],
+           "xtype" : "Box"
           }
-         ]
-        },
-        {
+         ],
          "listeners" : {
-          "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
+          "clicked" : [
+           "( ) => {",
+           "\tthis.updateMenu();",
+           "",
+           "\t _this.windowspopup.el.set_parent(this.el);",
+           "",
+           "\t _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); ",
+           "\t _this.windowspopup.el.popup(); ",
+           "}",
+           ""
+          ]
          },
-         "id" : "openbtn",
          "xtype" : "Button",
-         "* pack" : "add",
-         "$ xns" : "Gtk",
-         "$ tooltop_text" : "\"Open File\"",
-         "items" : [
-          {
-           "* pack" : "set_image",
-           "xtype" : "Image",
-           "utf8 icon_name" : "document-open",
-           "$ xns" : "Gtk"
-          }
+         "| void updateMenu" : [
+          "() {",
+          "\t foreach(var m in  this.mitems) {",
+          "\t \t _this.popover_menu.el.remove(m);",
+          "\t }",
+          "\t this.mitems.clear();",
+          "\t",
+          "\t BuilderApplication.windows.sort((a,b) => {",
+          "\t \tif (a.windowstate == null ||",
+          " \t\t\t a.windowstate.file == null || ",
+          " \t\t\t b.windowstate == null ||",
+          " \t\t\t b.windowstate.file == null",
+          " \t\t\t ) { ",
+          " \t\t\treturn 0;",
+          "\t\t}",
+          "",
+          "\t \tvar ap = a.windowstate.file.project.name;",
+          "\t \tvar bp = b.windowstate.file.project.name;",
+          "\t \t",
+          "",
+          "\t \t",
+          "\t \tif (ap != bp) {",
+          "\t \t\treturn ap.collate(bp);",
+          "\t \t}",
+          "\t \tvar af =  a.windowstate.file == null ? \"\" : a.windowstate.file.getTitle();",
+          "\t \tvar bf = b.windowstate.file == null ? \"\" : b.windowstate.file.getTitle();\t \t",
+          "\t\treturn af.collate(bf);",
+          "\t ",
+          "\t });",
+          "\t ",
+          "\t var p = \"\";",
+          "\t foreach(var w in BuilderApplication.windows) {",
+          "\t \tvar wid = BuilderApplication.windows.index_of(w);",
+          "\t \t// fixme find a better way to display this.",
+          " \t\tif (w.windowstate == null ||",
+          " \t\t\t w.windowstate.file == null || ",
+          " \t\t\t _this.windowstate == null ||",
+          " \t\t\t _this.windowstate.file == null",
+          " \t\t\t ) { ",
+          " \t\t\tcontinue;",
+          "\t\t}",
+          "\t \t// should not happen...",
+          "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
+          "\t \t\tcontinue;",
+          " \t\t}",
+          " \t\tif (w.windowstate.file.project.name != p || p != \"\") {",
+          " \t\t\tvar ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);",
+          " \t\t\t_this.popover_menu.el.append(ms);",
+          "\t\t \tms.show();",
+          "\t\t \tthis.mitems.add(ms);",
+          " \t\t}",
+          " \t\t",
+          " \t\tp = w.windowstate.file.project.name;",
+          " \t\t",
+          "",
+          " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
+          " \t\t",
+          " \t\t",
+          " \t\t",
+          "\t \tvar m = new Gtk.Button.with_label(",
+          "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.relpath",
+          "\t \t);",
+          "\t \tm.halign = Gtk.Align.START;",
+          "\t \t",
+          "\t \t",
+          "\t \t//w.windowstate.file.path);",
+          "\t \tm.clicked.connect(() => {",
+          "\t\t \t_this.windowspopup.el.hide();",
+          "\t \t\t BuilderApplication.windows.get(wid).el.present();",
+          "\t \t});",
+          "\t \t_this.popover_menu.el.append(m);",
+          "\t \t//m.show();",
+          "\t \tthis.mitems.add(m);",
+          "\t }",
+          "}"
          ]
         },
         {
+         "$ xns" : "Gtk",
+         "* pack" : "append",
+         "bool always_show_image" : true,
+         "id" : "open_projects_btn",
          "listeners" : {
-          "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
+          "clicked" : [
+           "  ( ) => {",
+           "  \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
+           "}"
+          ]
          },
-         "id" : "openbackbtn",
-         "utf8 tooltip_text" : "Back",
-         "xtype" : "Button",
-         "* pack" : "add",
-         "$ xns" : "Gtk",
-         "bool visible" : false,
-         "items" : [
-          {
-           "utf8 icon_name" : "go-previous",
-           "* pack" : "set_image",
-           "xtype" : "Image",
-           "$ xns" : "Gtk"
-          }
-         ]
+         "string icon_name" : "system-file-manager",
+         "string label" : "Files / Projects",
+         "tooltop_text" : "\"Open File\"",
+         "xtype" : "Button"
         }
-       ]
+       ],
+       "xtype" : "Box"
       }
-     ]
+     ],
+     "xtype" : "HeaderBar"
     },
     {
-     "id" : "vbox",
-     "xtype" : "Box",
-     "* pack" : "add",
      "$ xns" : "Gtk",
+     "* pack" : "set_child",
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
-     "$ homogeneous" : false,
+     "bool homogeneous" : false,
+     "bool vexpand" : true,
+     "id" : "vbox",
      "items" : [
       {
-       "id" : "mainpane",
-       "position" : 400,
-       "* pack" : "pack_start,true,true,0",
        "# int lastWidth" : 0,
-       "xtype" : "Paned",
        "$ xns" : "Gtk",
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+       "bool hexpand" : true,
+       "bool vexpand" : true,
+       "id" : "mainpane",
        "items" : [
         {
-         "id" : "leftpane",
-         "* pack" : "add1",
-         "xtype" : "Box",
          "$ xns" : "Gtk",
-         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+         "* prop" : "start_child",
+         "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+         "bool hexpand" : true,
+         "bool vexpand" : true,
+         "id" : "leftpane",
          "items" : [
           {
-           "id" : "editpane",
-           "* pack" : "pack_start,true,true,0",
-           "xtype" : "Paned",
            "$ xns" : "Gtk",
-           "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+           "id" : "editpane",
            "items" : [
             {
-             "id" : "tree",
-             "* pack" : "add1",
-             "xtype" : "Box",
              "$ xns" : "Gtk",
-             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
+             "* prop" : "start_child",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+             "bool hexpand" : true,
+             "bool vexpand" : true,
+             "id" : "tree",
+             "xtype" : "Box"
             },
             {
-             "id" : "props",
-             "* pack" : "add2",
-             "xtype" : "Box",
              "$ xns" : "Gtk",
-             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
+             "* prop" : "end_child",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+             "bool hexpand" : true,
+             "bool vexpand" : true,
+             "id" : "props",
+             "xtype" : "Box"
             }
-           ]
+           ],
+           "listeners" : {
+            "accept_position" : [
+             "( ) => {",
+             "\t_this.windowstate.left_tree.onresize();",
+             "\treturn true;",
+             "}",
+             ""
+            ],
+            "move_handle" : [
+             "(scroll) => {",
+             "\tGLib.debug(\"Move handle\");",
+             "\treturn true;",
+             "}"
+            ]
+           },
+           "xtype" : "Paned"
           }
-         ]
+         ],
+         "xtype" : "Box"
         },
         {
-         "* pack" : "add2",
-         "xtype" : "Box",
          "$ xns" : "Gtk",
+         "* prop" : "end_child",
          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+         "bool hexpand" : true,
+         "bool vexpand" : true,
          "items" : [
           {
-           "listeners" : {
-            "size_allocate" : "  (  alloc) => {\n    if (_this.windowstate == null) {\n        return;\n    }\n    _this.windowstate.resizeCanvas(); \n        \n}"
-           },
-           "id" : "clutterembed",
-           "* init" : "    var stage = this.el.get_stage();\n    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));\n    \n    \n",
-           "xtype" : "Embed",
-           "* pack" : "pack_start,true,true,0",
-           "$ xns" : "GtkClutter",
+           "$ xns" : "Gtk",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+           "bool hexpand" : true,
+           "bool vexpand" : true,
+           "id" : "rooviewbox",
+           "xtype" : "Box"
+          },
+          {
+           "$ xns" : "Gtk",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+           "bool hexpand" : true,
+           "bool vexpand" : true,
+           "id" : "codeeditviewbox",
+           "xtype" : "Box"
+          }
+         ],
+         "xtype" : "Box"
+        }
+       ],
+       "listeners" : {
+        "accept_position" : [
+         "( ) => {",
+         "\t_this.windowstate.left_tree.onresize();",
+         "\treturn true;",
+         "}",
+         ""
+        ]
+       },
+       "position" : 400,
+       "xtype" : "Paned"
+      },
+      {
+       "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+       "bool homogeneous" : false,
+       "bool vexpand" : false,
+       "items" : [
+        {
+         "$ tooltip_text" : "\"Project Details\"",
+         "$ xns" : "Gtk",
+         "bool always_show_image" : true,
+         "listeners" : {
+          "clicked" : [
+           "  ( ) => {",
+           "     ",
+           "     _this.windowstate.projectPopoverShow(_this.el, null, null);",
+           "   ",
+           "  ",
+           "}"
+          ]
+         },
+         "string icon_name" : "emblem-system",
+         "string label" : "Edit Project Settings",
+         "xtype" : "Button"
+        },
+        {
+         "$ tooltip_text" : "\"File Details\"",
+         "$ xns" : "Gtk",
+         "bool always_show_image" : true,
+         "listeners" : {
+          "clicked" : [
+           "  ( ) => {",
+           "  ",
+           "    // create a new file in project..",
+           "    if (_this.project == null || _this.windowstate.file == null) {",
+           "        return  ;",
+           "    }",
+           "     _this.windowstate.file_details.show(",
+           "        _this.windowstate.file, _this.el, false",
+           "    );",
+           "     ",
+           "    return  ;    ",
+           "",
+           "",
+           "}"
+          ]
+         },
+         "string icon_name" : "document-properties",
+         "string label" : "Edit File Properties",
+         "xtype" : "Button"
+        },
+        {
+         "$ xns" : "Gtk",
+         "bool always_show_image" : true,
+         "items" : [
+          {
+           "$ xns" : "Gtk",
+           "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
+           "* init" : [
+            "{",
+            "   // this.el.show();",
+            "}",
+            ""
+           ],
+           "* prop" : "popover",
+           "id" : "topbarmenu",
            "items" : [
             {
-             "id" : "rooview",
-             "* init" : "{\n   \n   \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            1.0f\n        )\n    );\n        \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(1.0f,1.0f);\n    \n    this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
-             "xtype" : "Actor",
-             "* pack" : "get_stage().add_child",
-             "$ xns" : "GtkClutter"
-            },
-            {
-             "id" : "objectview",
-             "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
-             "xtype" : "Actor",
-             "* pack" : "get_stage().add_child",
-             "$ xns" : "GtkClutter"
-            },
-            {
-             "id" : "codeeditview",
-             "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
-             "xtype" : "Actor",
-             "* pack" : "get_stage().add_child",
-             "$ xns" : "GtkClutter"
-            },
-            {
-             "id" : "addpropsview",
-             "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
-             "xtype" : "Actor",
-             "* pack" : "get_stage().add_child",
-             "$ xns" : "GtkClutter"
-            },
-            {
-             "id" : "buttonlayout",
-             "* init" : "{\n    \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n     \n    \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.5f,0.5f);\n     this.el.set_size(50,\n           _this.clutterembed.el.get_stage().height);\n     \n}",
-             "xtype" : "Actor",
-             "* pack" : "get_stage().add_child",
-             "$ xns" : "Clutter",
+             "$ xns" : "Gtk",
+             "* pack" : "set_child",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+             "int spacing" : 0,
              "items" : [
               {
-               "$ orientation" : "Clutter.Orientation.VERTICAL",
-               "xtype" : "BoxLayout",
-               "$ xns" : "Clutter",
-               "* prop" : "layout_manager"
-              },
-              {
-               "id" : "backbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
-                 "xtype" : "Actor",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n //  if (_this.windowstate.state == WindowState.State.FILEPROJECT) {\n    \n//\t     _this.windowstate.switchState(WindowState.State.FILES);\n  //   } else { \n\t    _this.windowstate.switchState(WindowState.State.PREVIEW);\n  //  }\n    \n\n}"
-                   },
-                   "utf8 tooltip_text" : "Back",
-                   "xtype" : "Button",
-                   "* pack" : false,
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "go-previous",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "editfilebutton",
-               "* init" : "this.el.set_size(50.0f,50.0f);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    if (_this.project == null || _this.windowstate.file == null) {\n        return  ;\n    }\n     _this.windowstate.file_details.show(\n        _this.windowstate.file, this.el\n    );\n     \n    return  ;    \n\n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"File Details\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "document-properties",
-                     "* pack" : "set_image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "projecteditbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n     \n     _this.windowstate.projectPopoverShow(this.el);\n   \n \n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Project Details\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "emblem-system",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
+               "$ xns" : "Gtk",
                "listeners" : {
-                "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
-                "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
+                "activate" : [
+                 " ( ) => {",
+                 "         Resources.singleton().fetchStart();",
+                 "}"
+                ]
                },
-               "id" : "objectshowbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.OBJECT);\n  \n \n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Add Child Element\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "utf8 icon_name" : "list-add",
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "addpropbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Add Property\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "format-justify-left",
-                     "* pack" : "set_image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
+               "string label" : "Download updated Resources",
+               "xtype" : "Button"
               },
               {
-               "id" : "addlistenerbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n    \n    _this.windowstate.switchState(WindowState.State.LISTENER);\n  \n\n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Add Event Code\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "appointment-new",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "addprojectbutton",
-               "* init" : "this.el.set_size(50.0f,50.0f);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =      EditProject.singleton();\n    pe.el.set_transient_for(_this.el);\n    pe.el.set_modal(true);   \n   \n    var p  = pe.show();\n\n    if (p == null) {\n        return;\n    }\n    \n    \n    _this.windowstate.left_projects.is_loaded = false;    \n    _this.windowstate.left_projects.load();\n    _this.windowstate.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"New\\nProj.\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "folder-new",
-                     "* pack" : "set_image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "addfilebutton",
-               "* init" : "this.el.set_size(50.0f,50.0f);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : " () => {\n    // create a new file in project..\n    print(\"add file selected\\n\");\n    // what's the currently selected project...\n    var proj = _this.windowstate.left_projects.getSelectedProject();\n    \n    if (proj == null) {\n\t\tprint(\"no project selected?\\n\");\n        return  ;\n    }\n    \n    print(\"creating file?\");\n    \n    var f = JsRender.JsRender.factory(proj.xtype,  proj, \"\");\n    _this.project = proj;\n        print(\"showing popup?\");\n     _this.windowstate.file_details.show(\n       f, this.el\n    );\n    \n    \n    return  ;    \n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Add File\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "utf8 icon_name" : "document-new",
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "delprojectbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
-                 "* pack" : "add_child",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n     \n     var cd = DialogConfirm.singleton();\n     cd.el.set_transient_for(_this.el);\n    cd.el.set_modal(true);\n\n     var project =   _this.windowstate.left_projects.getSelectedProject();\n    if (project == null) {\n        print(\"SKIP - no project\\n\");\n        return;\n    }\n    \n        \n     if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n        \"Are you sure you want to delete project %s\".printf(project.name))) {\n        return;\n    }\n     \n\n    // confirm?\n    Project.Project.remove(project);\n    _this.project = null;\n    \n    _this.windowstate.left_projects.is_loaded =  false;\n    _this.windowstate.left_projects.load();\n    _this.windowstate.clutterfiles.clearFiles();\n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "$ tooltip_text" : "\"Delete Project\"",
-                   "height_request" : 50,
-                   "items" : [
-                    {
-                     "xtype" : "Image",
-                     "utf8 icon_name" : "user-trash",
-                     "* pack" : "set_image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
+               "$ xns" : "Gtk",
+               "listeners" : {
+                "clicked" : [
+                 "() => {",
+                 "    About.singleton().el.show();",
+                 "    }"
+                ]
+               },
+               "string label" : "About the Builder",
+               "xtype" : "Button"
               }
-             ]
+             ],
+             "xtype" : "Box"
             }
-           ]
+           ],
+           "xtype" : "PopoverMenu"
           }
-         ]
-        }
-       ]
-      },
-      {
-       "bool homogeneous" : false,
-       "* pack" : "pack_end,false,true,0",
-       "xtype" : "Box",
-       "$ xns" : "Gtk",
-       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-       "items" : [
+         ],
+         "string icon_name" : "dialog-information",
+         "string label" : "About",
+         "xtype" : "MenuButton"
+        },
         {
+         "$ xns" : "Gtk",
+         "bool hexpand" : true,
          "string label" : "   ",
-         "* pack" : "pack_start,true,true,0",
-         "xtype" : "Label",
-         "$ xns" : "Gtk"
+         "xtype" : "Label"
         },
         {
+         "$ xns" : "Gtk",
+         "* init" : [
+          "{",
+          "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
+          "        if (pos < 1) {",
+          "            this.el.hide();",
+          "            _this.mainpane.el.set_sensitive(true);",
+          "            ",
+          "            return;",
+          "        }",
+          "         _this.mainpane.el.set_sensitive(false);",
+          "         this.el.show();",
+          "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
+          "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
+          "       ",
+          "     });",
+          "}",
+          ""
+         ],
          "bool show_text" : true,
-         "ulong handler_id" : "-1",
          "id" : "statusbar",
-         "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));\n       \n     });\n}\n",
-         "xtype" : "ProgressBar",
-         "* pack" : "pack_start,true,true,0",
-         "$ xns" : "Gtk"
-        },
-        {
-         "listeners" : {
-          "key_press_event" : "(event) => {\n    \n \tif (event.keyval == Gdk.Key.Return) {\n\t\tthis.forwardSearch(false);\n\t    return true;\n\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} ",
-          "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\t_this.search_results.el.hide();\n\t\treturn;\n\t}\n\tvar res = 0;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t} else { \n\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tbreak;\n\t}\n\t_this.search_results.el.show();\n\tif (res > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
-         },
-         "id" : "search_entry",
-         "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
-         "* pack" : "pack_start,false,true,0",
-         "xtype" : "SearchEntry",
-         "$ xns" : "Gtk",
-         "| void forwardSearch" : "(bool change_focus) {\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\t_this.windowstate.code_editor.forwardSearch(change_focus);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);\n\t\t\t} else { \n\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\t\n}\n"
+         "ulong handler_id" : "-1",
+         "xtype" : "ProgressBar"
         },
         {
-         "xtype" : "MenuBar",
-         "* pack" : "add",
+         "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
          "$ xns" : "Gtk",
          "items" : [
           {
-           "listeners" : {
-            "button_press_event" : "() => {\n/*\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    */\n    return true;\n}"
-           },
-           "bool always_show_image" : true,
-           "id" : "search_results",
-           "Xcls_ValaCompileErrors popup" : "",
-           "string label" : "Matches",
-           "* pack" : "add",
-           "xtype" : "ImageMenuItem",
            "$ xns" : "Gtk",
-           "items" : [
-            {
-             "utf8 icon_name" : "system-search",
-             "* pack" : "set_image",
-             "xtype" : "Image",
-             "bool sensitive" : false,
-             "$ xns" : "Gtk"
-            }
-           ]
-          },
-          {
-           "* pack" : "add",
-           "xtype" : "MenuItem",
+           "id" : "statusbar_compilestatus_label",
+           "int margin_end" : 4,
+           "int margin_start" : 4,
            "string label" : "Compile Status:",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
+           "$ xns" : "Gtk",
+           "Xcls_ValaCompileErrors popup" : "",
+           "id" : "statusbar_errors",
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "clicked" : [
+             "() => {",
+             " ",
+             "\tif (this.popup == null) {",
+             "\t\treturn;",
+             "\t}",
+             "   ",
+             "    this.popup.show();",
+             "  ",
+             "}"
+            ]
            },
-           "bool always_show_image" : true,
-           "id" : "statusbar_errors",
-           "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Errors\";\n    this.notices = nots;\n\n}\n",
-           "Xcls_ValaCompileErrors popup" : "",
-           "string label" : "Errors",
-           "* pack" : "add",
-           "xtype" : "ImageMenuItem",
-           "# Json.Object notices" : "new Json.Object() ",
-           "$ xns" : "Gtk",
-           "items" : [
-            {
-             "* pack" : "set_image",
-             "xtype" : "Image",
-             "utf8 icon_name" : "dialog-error",
-             "$ xns" : "Gtk"
-            }
+           "string icon_name" : "dialog-error",
+           "string label" : "0 Errors",
+           "xtype" : "Button",
+           "| void setNotices" : [
+            "(GLib.ListStore nots, GLib.ListStore fe ) {",
+            "    ",
+            "     if (nots.get_n_items() < 1 ) {",
+            "    \tthis.el.hide();",
+            "    \tif (this.popup != null) {",
+            "    \t\tthis.popup.el.hide();",
+            "\t\t}",
+            "    \treturn;",
+            "    }",
+            "    ",
+            "    this.el.show();",
+            "    this.el.label = \"%d/%d Errors\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
+            "",
+            "    ",
+            " ",
+            "\tif (this.popup == null) {",
+            "        this.popup = new Xcls_ValaCompileErrors();",
+            "        this.popup.window = _this;",
+            "      //    this.popup.el.set_transient_for( _this.el );",
+            "        this.popup.el.set_parent(this.el);",
+            "    }",
+            "\tthis.popup.updateNotices(nots);",
+            "\t ",
+            "}",
+            ""
            ]
           },
           {
+           "$ xns" : "Gtk",
+           "Xcls_ValaCompileErrors popup" : "",
+           "id" : "statusbar_warnings",
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "clicked" : [
+             "() => {",
+             " ",
+             "\tif (this.popup == null) {",
+             "\t\treturn;",
+             "\t}",
+             "   ",
+             "    this.popup.show();",
+             "    return;",
+             "}"
+            ]
            },
-           "bool always_show_image" : true,
-           "id" : "statusbar_warnings",
-           "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Warnings\";\n    this.notices = nots;\n\n}\n",
-           "Xcls_ValaCompileErrors popup" : "",
-           "* pack" : "add",
-           "string label" : "Warnings",
-           "xtype" : "ImageMenuItem",
-           "# Json.Object notices" : "new Json.Object()",
-           "$ xns" : "Gtk",
-           "items" : [
-            {
-             "utf8 icon_name" : "dialog-warning",
-             "* pack" : "set_image",
-             "xtype" : "Image",
-             "$ xns" : "Gtk"
-            }
+           "string icon_name" : "dialog-warning",
+           "string label" : "0 Warnings",
+           "xtype" : "Button",
+           "| void setNotices" : [
+            "(GLib.ListStore nots, GLib.ListStore fe ) {",
+            "    ",
+            "     if (nots.get_n_items() < 1 ) {",
+            "    \tthis.el.hide();",
+            "    \tif (this.popup != null) {",
+            "    \t\tthis.popup.el.hide();",
+            "\t\t}",
+            "    \treturn;",
+            "    }",
+            "    ",
+            "    this.el.show();",
+            "    this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
+            "",
+            "    ",
+            " ",
+            "\tif (this.popup == null) {",
+            "        this.popup = new Xcls_ValaCompileErrors();",
+            "        this.popup.window = _this;",
+            "      //    this.popup.el.set_transient_for( _this.el );",
+            "        this.popup.el.set_parent(this.el);",
+            "    }",
+            "\tthis.popup.updateNotices(nots);",
+            "\t ",
+            "}",
+            ""
            ]
           },
           {
+           "# GLib.ListStore notices" : "null",
+           "$ xns" : "Gtk",
+           "Xcls_ValaCompileErrors popup" : "",
+           "id" : "statusbar_depricated",
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "clicked" : [
+             "() => {",
+             " ",
+             "\tif (this.popup == null) {",
+             "\t\treturn;",
+             "\t}",
+             "   ",
+             "    this.popup.show();",
+             "  ",
+             "}"
+            ]
            },
-           "bool always_show_image" : true,
-           "id" : "statusbar_depricated",
-           "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Depricated\";\n    this.notices = nots;\n\n}\n",
-           "Xcls_ValaCompileErrors popup" : "",
-           "string label" : "Depricated",
-           "* pack" : "add",
-           "xtype" : "ImageMenuItem",
-           "# Json.Object notices" : "new Json.Object()",
-           "$ xns" : "Gtk",
-           "items" : [
-            {
-             "xtype" : "Image",
-             "utf8 icon_name" : "dialog-information",
-             "* pack" : "set_image",
-             "$ xns" : "Gtk"
-            }
+           "string icon_name" : "dialog-information",
+           "string label" : "0 Depricated",
+           "xtype" : "Button",
+           "| void setNotices" : [
+            "",
+            "(GLib.ListStore nots, GLib.ListStore fe ) {",
+            "    ",
+            "     if (nots.get_n_items() < 1 ) {",
+            "    \tthis.el.hide();",
+            "    \tif (this.popup != null) {",
+            "    \t\tthis.popup.el.hide();",
+            "\t\t}",
+            "    \treturn;",
+            "    }",
+            "    ",
+            "    this.el.show();",
+            "    this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
+            "",
+            "    ",
+            " ",
+            "\tif (this.popup == null) {",
+            "        this.popup = new Xcls_ValaCompileErrors();",
+            "        this.popup.window = _this;",
+            "      //    this.popup.el.set_transient_for( _this.el );",
+            "        this.popup.el.set_parent(this.el);",
+            "    }",
+            "\tthis.popup.updateNotices(nots);",
+            "\t ",
+            "}",
+            ""
            ]
           },
           {
+           "$ xns" : "Gtk",
+           "Xcls_ValaCompileErrors popup" : "",
+           "id" : "statusbar_run",
            "listeners" : {
-            "button_press_event" : "() => {\n\tif (_this.windowstate.file == null) {\n\t\treturn true;\n\t}\n\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);\n\t\n\t_this.windowstate.compile_results.show(this.el,true);\n\t\n\treturn true;\n}"
+            "clicked" : [
+             "() => {",
+             "   ",
+             "   if (_this.windowstate.file == null) {",
+             "\t\treturn;",
+             "\t}",
+             "   if (_this.statusbar_compile_spinner.el.spinning) {",
+             "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
+             "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
+             "    \treturn;",
+             "\t}",
+             "\t",
+             "\tvar req = new Palete.ValaCompileRequest(",
+             "\t\tPalete.ValaCompileRequestType.RUN,",
+             "\t\t_this.windowstate.file,",
+             "\t\tnull,",
+             "\t\tnull,",
+             "\t\t\"\"",
+             "\t);",
+             "\treq.run();",
+             "\t ",
+             "\t_this.windowstate.compile_results.el.set_parent(this.el);",
+             "\t_this.windowstate.compile_results.show(this.el,true);",
+             "\t         ",
+             "}"
+            ]
            },
-           "bool always_show_image" : true,
-           "id" : "statusbar_run",
-           "Xcls_ValaCompileErrors popup" : "",
+           "string icon_name" : "media-playback-start",
            "string label" : "Run",
-           "* pack" : "add",
-           "xtype" : "ImageMenuItem",
-           "$ xns" : "Gtk",
-           "items" : [
-            {
-             "utf8 icon_name" : "media-playback-start",
-             "* pack" : "set_image",
-             "xtype" : "Image",
-             "$ xns" : "Gtk"
-            }
-           ]
+           "xtype" : "Button"
           }
-         ]
+         ],
+         "xtype" : "Box"
         },
         {
+         "$ xns" : "Gtk",
          "id" : "statusbar_compile_spinner",
-         "* pack" : "add",
+         "int margin_end" : 4,
+         "int margin_start" : 4,
+         "string tooltip_text" : "Compiling",
          "xtype" : "Spinner",
-         "| void stop" : "() {\n this.el.stop();\n  this.el.hide();\n}\n",
-         "$ xns" : "Gtk",
-         "| void start" : "() {\n  this.el.show();\n  this.el.start();  \n}\n"
+         "| void start" : [
+          "() {",
+          "  this.el.show();",
+          "  this.el.start();  ",
+          "  ",
+          "\t ",
+          "}",
+          ""
+         ],
+         "| void stop" : [
+          "() {",
+          " this.el.stop();",
+          "  this.el.hide();",
+          "   ",
+          "}",
+          ""
+         ]
         }
-       ]
+       ],
+       "xtype" : "Box"
       }
-     ]
+     ],
+     "xtype" : "Box"
     }
+   ],
+   "listeners" : {
+    "close_request" : [
+     "( ) => {",
+     "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
+     "\t ",
+     "\t ",
+     "\t this.windowstate.file.getLanguageServer().document_close(",
+     "\t \tthis.windowstate.file",
+     " \t);",
+     "\t ",
+     "\t BuilderApplication.removeWindow(this);",
+     "\t ",
+     "\t if (BuilderApplication.windows.size  < 1) {",
+     "\t\tthis.windowstate.file.getLanguageServer().exit();",
+     "\t\tBuilderApplication.singleton(  null ).quit();",
+     "\t }",
+     "\treturn true;",
+     "}",
+     ""
+    ],
+    "hide" : [
+     "() =>  {",
+     " ",
+     " ",
+     "",
+     "}"
+    ],
+    "show" : [
+     "  ( ) => {",
+     "    // hide the file editing..",
+     "   ",
+     "    //this.hideViewEditing();",
+     "    // this is updated by windowstate - we try and fill it in..",
+     "     _this.statusbar.el.hide();",
+     "     //_this.statusbar_errors.el.hide();",
+     "    //_this.statusbar_warnings.el.hide();",
+     "    //_this.statusbar_depricated.el.hide();",
+     "    _this.statusbar_compile_spinner.el.hide();",
+     "  ",
+     "    Resources.singleton().checkResources();",
+     "    ",
+     "  ",
+     "",
+     "}"
+    ]
+   },
+   "string title" : "Roo Application Builder",
+   "xtype" : "ApplicationWindow",
+   "| void initChildren" : [
+    " () {",
+    "    // this needs putting in a better place..",
+    "    this.windowstate = new WindowState(this);",
+    "     ",
+    "",
+    " ",
+    "",
+    "    ",
+    "",
+    "",
+    "",
+    "}",
+    ""
+   ],
+   "| void openNewWindow" : [
+    "() {",
+    " ",
+    "    var w = new Xcls_MainWindow();",
+    "    w.ref();",
+    "\tBuilderApplication.addWindow(w);",
+    "    w.el.show();",
+    "    w.initChildren();",
+    "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
+    "     ",
+    "}",
+    ""
+   ],
+   "| void setTitle" : [
+    " () {",
+    "    if (_this.windowstate.project == null || ",
+    "\t    _this.windowstate.file == null",
+    "    ) {",
+    "    \tthis.el.set_title(\"Select File\");",
+    "    \treturn;",
+    "\t}",
+    "    _this.el.set_title(",
+    "    \t_this.windowstate.project.name + ",
+    "    \t\" - \" +",
+    "\t\t_this.windowstate.file.relpath);",
+    "} "
+   ],
+   "| void show" : [
+    "() {",
+    "   ",
+    "    this.el.show();",
+    "    if (this.windowstate.file  == null) {",
+    "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
+    "    }",
+    "}"
+   ],
+   "| void updateErrors" : [
+    "() {",
+    "",
+    "",
+    " \tGLib.debug(\"updateErrors\");",
+    "\t",
+    "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
+    "\t",
+    "\tthis.statusbar_errors.setNotices(",
+    "\t\tpr,",
+    "\t\tthis.windowstate.file.getErrors(\"ERR\")",
+    "\t);",
+    "\t",
+    "\tthis.statusbar_warnings.setNotices(",
+    "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
+    "\t\tthis.windowstate.file.getErrors(\"WARN\")",
+    "\t);",
+    "\tthis.statusbar_depricated.setNotices(",
+    "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
+    "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
+    "\t);",
+    " ",
+    "\t_this.statusbar_run.el.hide();",
+    "",
+    "\tif (pr.get_n_items() < 1) {",
+    "\t\t_this.statusbar_run.el.show();",
+    "\t} ",
+    "\t",
+    "}"
    ]
   }
- ]
+ ],
+ "name" : "MainWindow"
 }
\ No newline at end of file