src/Builder4/ValaProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ValaProjectSettings.bjs
1 {
2  "name" : "ValaProjectSettings",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/ValaProjectSettings.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "",
9  "items" : [
10   {
11    "# Project.Gtk project" : "null",
12    "# Xcls_MainWindow window" : "null",
13    "| void show" : "(Project.Gtk project) {\n    \n    \n    print(\"ValaProjectSettings show\\n\");\n    \n    this.project=  project;\n\n    this.compile_flags.el.text = _this.project.compilegroups.get(\"_default_\").compile_flags;\n    \n    this.default_directory_tree_store.load();    \n    this.default_packages_tree_store.load();            \n    this.targets_tree_store.load();\n    this.files_tree_store.load();\n\n}\n",
14    "xtype" : "VBox",
15    "string id" : "ValaProjectSettings",
16    "| void save" : "()  {\n    this.project.writeConfig();\n}",
17    "$ xns" : "Gtk",
18    "items" : [
19     {
20      "* pack" : "pack_start,true,true,0",
21      "xtype" : "Notebook",
22      "$ xns" : "Gtk",
23      "items" : [
24       {
25        "id" : "label_global",
26        "xtype" : "Label",
27        "* pack" : false,
28        "$ xns" : "Gtk",
29        "utf8 label" : "Global"
30       },
31       {
32        "id" : "label_targets",
33        "* pack" : false,
34        "xtype" : "Label",
35        "$ xns" : "Gtk",
36        "utf8 label" : "Targets"
37       },
38       {
39        "xtype" : "VBox",
40        "* pack" : "append_page,_this.label_global.el",
41        "gboolean homogeneous" : false,
42        "$ xns" : "Gtk",
43        "items" : [
44         {
45          "xtype" : "Label",
46          "* pack" : "pack_start,false,false,0",
47          "$ xns" : "Gtk",
48          "utf8 label" : "compile flags"
49         },
50         {
51          "listeners" : {
52           "changed" : "() => {\n    \n   _this.project.compilegroups.get(\"_default_\").compile_flags = this.el.text;\n   _this.project.writeConfig();\n//    _this.project.save();\n\n}"
53          },
54          "id" : "compile_flags",
55          "xtype" : "Entry",
56          "* pack" : "pack_start,false,false,0",
57          "$ xns" : "Gtk",
58          "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR "
59         },
60         {
61          "xtype" : "Label",
62          "* pack" : "pack_start,false,false,0",
63          "$ xns" : "Gtk",
64          "utf8 label" : "packages"
65         },
66         {
67          "* pack" : "pack_start,true,true,0",
68          "xtype" : "HBox",
69          "$ xns" : "Gtk",
70          "items" : [
71           {
72            "* pack" : "pack_start,true,true,0",
73            "xtype" : "ScrolledWindow",
74            "$ xns" : "Gtk",
75            "items" : [
76             {
77              "gboolean headers_visible" : false,
78              "* pack" : "add",
79              "xtype" : "TreeView",
80              "string id" : "default_packages_tree",
81              "$ xns" : "Gtk",
82              "items" : [
83               {
84                "id" : "default_packages_tree_store",
85                "* pack" : "set_model",
86                "xtype" : "ListStore",
87                "$ n_columns" : 2,
88                "| void load" : "() {\n \n    var def = _this.project.compilegroups.get(\"_default_\");\n    var items  = def.packages;\n    \n    this.el.clear();\n    var pal = (Palete.Gtk) Palete.factory(\"Gtk\");\n    var pkgs = pal.packages(_this.project);\n    print(\"ValaProjectSettings:packages load %d\\n\", pkgs.size);\n\n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < pkgs.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   pkgs.get(i) ); // title \n        this.el.set_value(citer, 1,   items.contains(pkgs.get(i)) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
89                "$ columns" : "    typeof(string),  // 0 key type\n      typeof(bool)",
90                "$ xns" : "Gtk"
91               },
92               {
93                "utf8 title" : "name",
94                "* init" : " \n this.el.add_attribute(_this.packages_render.el , \"text\", 0 );\n  ",
95                "* pack" : "append_column",
96                "xtype" : "TreeViewColumn",
97                "gboolean resizable" : true,
98                "gboolean expand" : true,
99                "$ xns" : "Gtk",
100                "items" : [
101                 {
102                  "id" : "packages_render",
103                  "* pack" : "pack_start,false",
104                  "xtype" : "CellRendererText",
105                  "$ xns" : "Gtk"
106                 }
107                ]
108               },
109               {
110                "utf8 title" : "use",
111                "* init" : "{\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n }",
112                "* pack" : "append_column",
113                "xtype" : "TreeViewColumn",
114                "gboolean resizable" : false,
115                "$ xns" : "Gtk",
116                "gint fixed_width" : 50,
117                "items" : [
118                 {
119                  "listeners" : {
120                   "toggled" : "(  path_string) =>  { \n    var m = _this.default_packages_tree_store.el;\n   Gtk.TreeIter iter;\n   Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n   m.get_iter (out iter, path);\n   GLib.Value val;\n   m.get_value(iter, 1, out val);\n   m.set_value(iter, 1,  ((bool) val) ? false :true); \n     GLib.Value fval;  \n   m.get_value(iter, 0, out fval);\n   var fn = (string)fval;\n    \n    var def = _this.project.compilegroups.get(\"_default_\");\n    var items  = def.packages;\n    if ((bool)val) {\n        // renive\n        items.remove(fn);\n    } else {\n        items.add(fn);\n    }\n    \n}"
121                  },
122                  "id" : "packages_render_use",
123                  "xtype" : "CellRendererToggle",
124                  "* pack" : "pack_start,false",
125                  "$ xns" : "Gtk",
126                  "gboolean activatable" : true
127                 }
128                ]
129               }
130              ]
131             }
132            ]
133           }
134          ]
135         },
136         {
137          "xtype" : "Label",
138          "* pack" : "pack_start,false,false,0",
139          "$ xns" : "Gtk",
140          "utf8 label" : "Available Directories"
141         },
142         {
143          "* pack" : "pack_start,true,true,0",
144          "xtype" : "ScrolledWindow",
145          "$ xns" : "Gtk",
146          "items" : [
147           {
148            "listeners" : {
149             "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.default_directory_menu.el.show_all();\n      _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}"
150            },
151            "gboolean headers_visible" : false,
152            "id" : "default_directory_tree",
153            "* pack" : "add",
154            "xtype" : "TreeView",
155            "$ xns" : "Gtk",
156            "items" : [
157             {
158              "id" : "default_directory_tree_store",
159              "* pack" : "set_model",
160              "xtype" : "ListStore",
161              "$ n_columns" : 1,
162              "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
163              "$ columns" : "    typeof(string)\n     ",
164              "$ xns" : "Gtk"
165             },
166             {
167              "utf8 title" : "name",
168              "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n  ",
169              "* pack" : "append_column",
170              "xtype" : "TreeViewColumn",
171              "gboolean resizable" : true,
172              "$ xns" : "Gtk",
173              "items" : [
174               {
175                "id" : "directory_render",
176                "* pack" : "pack_start,false",
177                "xtype" : "CellRendererText",
178                "$ xns" : "Gtk"
179               }
180              ]
181             }
182            ]
183           },
184           {
185            "id" : "default_directory_menu",
186            "xtype" : "Menu",
187            "$ xns" : "Gtk",
188            "items" : [
189             {
190              "listeners" : {
191               "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
192              },
193              "* pack" : "add",
194              "xtype" : "MenuItem",
195              "$ xns" : "Gtk",
196              "utf8 label" : "Add Directory"
197             },
198             {
199              "listeners" : {
200               "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.OPEN ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
201              },
202              "* pack" : "add",
203              "xtype" : "MenuItem",
204              "$ xns" : "Gtk",
205              "utf8 label" : "Add File"
206             },
207             {
208              "* pack" : "add",
209              "xtype" : "SeparatorMenuItem",
210              "$ xns" : "Gtk"
211             },
212             {
213              "listeners" : {
214               "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {\n                  print(\"remove failed\");\n              }\n       _this.default_directory_tree_store.load();\n}"
215              },
216              "* pack" : "add",
217              "xtype" : "MenuItem",
218              "$ xns" : "Gtk",
219              "utf8 label" : "Remove File/Directory"
220             }
221            ]
222           }
223          ]
224         }
225        ]
226       },
227       {
228        "gint position" : 300,
229        "xtype" : "HPaned",
230        "* pack" : "append_page,_this.label_targets.el",
231        "$ xns" : "Gtk",
232        "items" : [
233         {
234          "* init" : "{  \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
235          "xtype" : "ScrolledWindow",
236          "* pack" : "add1",
237          "$ xns" : "Gtk",
238          "items" : [
239           {
240            "id" : "targets_tree_menu",
241            "* pack" : "add",
242            "xtype" : "Menu",
243            "$ xns" : "Gtk",
244            "items" : [
245             {
246              "listeners" : {
247               "activate" : "()  => {\n    \n       if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {\n        return;\n    }\n      \n       // add the directory..\n       \n       _this.project.compilegroups.set(\"NEW GROUP\", new Project.GtkValaSettings(\"NEW GROUP\"));\n       _this.targets_tree_store.load();\n}"
248              },
249              "* pack" : "add",
250              "xtype" : "MenuItem",
251              "$ xns" : "Gtk",
252              "utf8 label" : "Add Compile Target"
253             },
254             {
255              "* pack" : "add",
256              "xtype" : "SeparatorMenuItem",
257              "$ xns" : "Gtk"
258             },
259             {
260              "listeners" : {
261               "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.unset(fn)) {\n                  print(\"remove failed\");\n      }\n       _this.targets_tree_store.load();\n}"
262              },
263              "* pack" : "add",
264              "xtype" : "MenuItem",
265              "$ xns" : "Gtk",
266              "utf8 label" : "Remove Target"
267             }
268            ]
269           },
270           {
271            "listeners" : {
272             "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.targets_tree_menu.el.show_all();\n      _this.targets_tree_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}",
273             "cursor_changed" : " ( ) => {\n\n    if (this.cursor != \"\") {\n         // save the values..\n     }\n     \n     // load the new values.\n     \n\n         Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!this.el.get_selection().get_selected(out mod, out iter)) {\n            print(\"nothing selected\\n\");\n            // should disable the right hand side..\n            _this.set_vbox.el.hide();\n            return;\n        }\n        _this.set_vbox.el.show();\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       this.cursor = fn;\n       var cg = _this.project.compilegroups.get(fn);\n       \n       _this.build_pack_target.el.set_text(cg.target_bin);\n       _this.build_compile_flags.el.set_text(cg.compile_flags);\n       _this.set_vbox.cgroup = cg;\n       _this.files_tree_store.update();\n       \n       // load the srouces\n       \n\n  }"
274            },
275            "id" : "targets_tree",
276            "# string cursor" : "",
277            "* pack" : "add",
278            "xtype" : "TreeView",
279            "$ xns" : "Gtk",
280            "items" : [
281             {
282              "id" : "targets_tree_store",
283              "xtype" : "ListStore",
284              "* pack" : "set_model",
285              "$ n_columns" : 2,
286              "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var cg = _this.project.compilegroups;\n     \n   _this.targets_tree.cursor = \"\";\n    Gtk.TreeIter citer;\n    var iter = cg.map_iterator();\n   while(iter.next()) {\n        var key = iter.get_key();\n        if (key == \"_default_\") {\n            continue;\n        }\n    \n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   key ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    };\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    _this.set_vbox.el.hide();\n}\n",
287              "$ columns" : "    typeof(string),  // 0 key type\n     typeof(string) // ??\n     ",
288              "$ xns" : "Gtk"
289             },
290             {
291              "utf8 title" : "name",
292              "* init" : " {\n     this.el.add_attribute(_this.targets_render.el , \"text\", 0 );\n }",
293              "* pack" : "append_column",
294              "xtype" : "TreeViewColumn",
295              "gboolean resizable" : true,
296              "$ xns" : "Gtk",
297              "items" : [
298               {
299                "listeners" : {
300                 "edited" : "  (path, newtext) => {\n     \n     Gtk.TreeIter  iter;\n        _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n       GLib.Value gval;\n        _this.targets_tree_store.el.get_value(iter,0, out gval);\n        var oldval = (string)gval;\n       if (oldval == newtext) {\n          return;\n        }\n         var cg = _this.project.compilegroups.get(oldval);\n        cg.name = newtext;\n        _this.project.compilegroups.unset(oldval);\n        _this.project.compilegroups.set(newtext, cg);\n       _this.targets_tree_store.load();\n  }"
301                },
302                "id" : "targets_render",
303                "xtype" : "CellRendererText",
304                "* pack" : "pack_start,false",
305                "$ xns" : "Gtk",
306                "gboolean editable" : true
307               }
308              ]
309             }
310            ]
311           }
312          ]
313         },
314         {
315          "id" : "set_vbox",
316          "xtype" : "VBox",
317          "* pack" : "add2",
318          "gboolean homogeneous" : false,
319          "$ xns" : "Gtk",
320          "# Project.GtkValaSettings cgroup" : "null",
321          "items" : [
322           {
323            "xtype" : "Label",
324            "* pack" : "pack_start,false,false,0",
325            "$ xns" : "Gtk",
326            "utf8 label" : "target filename"
327           },
328           {
329            "listeners" : {
330             "changed" : "()  => {\n        if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;\n}"
331            },
332            "id" : "build_pack_target",
333            "xtype" : "Entry",
334            "* pack" : "pack_start,false,false,0",
335            "$ xns" : "Gtk"
336           },
337           {
338            "xtype" : "Label",
339            "* pack" : "pack_start,false,false,0",
340            "$ xns" : "Gtk",
341            "utf8 label" : "compile flags"
342           },
343           {
344            "listeners" : {
345             "changed" : "() => {\n    if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;\n}"
346            },
347            "id" : "build_compile_flags",
348            "xtype" : "Entry",
349            "* pack" : "pack_start,false,false,0",
350            "$ xns" : "Gtk"
351           },
352           {
353            "xtype" : "Label",
354            "* pack" : "pack_start,false,false,0",
355            "$ xns" : "Gtk",
356            "utf8 label" : "Files to compile"
357           },
358           {
359            "* pack" : "pack_start,true,true,0",
360            "xtype" : "ScrolledWindow",
361            "$ xns" : "Gtk",
362            "items" : [
363             {
364              "xtype" : "TreeView",
365              "* pack" : "add",
366              "string id" : "files_tree",
367              "$ xns" : "Gtk",
368              "items" : [
369               {
370                "id" : "files_tree_store",
371                "xtype" : "ListStore",
372                "* pack" : "set_model",
373                "| void updateDir" : "(string dname, bool bval) {\n  \n  Gtk.TreeIter citer;\n\n    var cg =   _this.set_vbox.cgroup;\n  for(var i =0 ; i < this.el.iter_n_children(null); i++) {\n        this.el.iter_nth_child(out citer,null,i);\n\n        GLib.Value val;\n        this.el.get_value(citer,0, out val);\n        var fn = (string) val;\n        \n        if ( Path.get_dirname (fn) == dname) {\n        \n            this.el.set_value(citer, 3,   bval ); // checked \n           \n     \n     \n            if (!bval) {\n                // renive\n                if (cg.sources.contains(fn)) {\n                    cg.sources.remove(fn);\n                }\n            } else {\n                if (!cg.sources.contains(fn)) {\n                    cg.sources.add(fn);\n                }\n            }\n            \n            \n        }\n    }\n\n}\n",
374                "$ n_columns" : 4,
375                "| void load" : "() {\n \n      this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n     \n     \n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n    \n         var files = _this.project.files(items.get(i));\n         if (files.size < 1) {\n            continue;\n         }\n    \n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        this.el.set_value(citer, 1,   \"<span foreground=\\\"green\\\" font_weight=\\\"bold\\\">\" + \n                    GLib.Markup.escape_text(items.get(i)) + \"</span>\"\n            ); // title \n        print(\"ADD item %s\", items.get(i));\n        this.el.set_value(citer, 2,   \"dir\"); // type         \n        this.el.set_value(citer, 3,   false ); // checked \n\n       \n        \n         for(var j =0 ; j < files.size; j++) {\n            this.el.append(out citer);   \n             print(\"ADD item %s\", files.get(j));\n            this.el.set_value(citer, 0,   files.get(j) ); // title \n            this.el.set_value(citer, 1,   GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title             \n            this.el.set_value(citer, 2,   \"file\"); // type         \n            this.el.set_value(citer, 3,   false ); // checked \n\n        }\n        \n        \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n ",
376                "$ columns" : "    typeof(string),  // 0 file name\n        typeof(string),  // 0 basename\n     typeof(string), // type (dir orfile)\n     typeof(bool)  // is checked.\n     ",
377                "$ xns" : "Gtk",
378                "| void update" : "() {\n\n\n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < this.el.iter_n_children(null); i++) {\n        this.el.iter_nth_child(out citer,null,i);\n\n        GLib.Value val;\n        this.el.get_value(citer,0, out val);\n        var fn = (string) val;\n        \n        var active = false;\n        if (_this.set_vbox.cgroup.sources.contains(fn)) {\n            active = true;\n        }\n        \n        this.el.set_value(citer, 3,   active ); // checked \n    }\n\n\n}\n"
379               },
380               {
381                "utf8 title" : "name",
382                "* init" : "\n this.el.add_attribute(_this.files_render.el , \"markup\", 1 ); // basnemae\n \n/*  this.el.add_attribute(_this.files_render.el , \"markup\", 2 );\n*/",
383                "* pack" : "append_column",
384                "xtype" : "TreeViewColumn",
385                "gboolean resizable" : true,
386                "$ xns" : "Gtk",
387                "items" : [
388                 {
389                  "id" : "files_render",
390                  "* pack" : "pack_start,false",
391                  "xtype" : "CellRendererText",
392                  "$ xns" : "Gtk"
393                 }
394                ]
395               },
396               {
397                "utf8 title" : "use",
398                "* init" : "{\n this.el.add_attribute(_this.files_render_use.el , \"active\", 3 );\n }",
399                "* pack" : "append_column",
400                "xtype" : "TreeViewColumn",
401                "gboolean resizable" : false,
402                "$ xns" : "Gtk",
403                "gint fixed_width" : 50,
404                "items" : [
405                 {
406                  "listeners" : {
407                   "toggled" : "(  path_string) =>  { \n\n\n\n    var m = _this.files_tree_store.el;\n   Gtk.TreeIter iter;\n   Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n   m.get_iter (out iter, path);\n   GLib.Value val;\n   m.get_value(iter, 3, out val);\n   m.set_value(iter, 3,  ((bool) val) ? false :true); \n   \n   // type.\n   GLib.Value ftval;  \n   m.get_value(iter, 2, out ftval);\n   var ftype = (string)ftval;   \n   \n   // full name...  \n   GLib.Value fval;     \n   m.get_value(iter, 0, out fval);\n   var fn = (string)fval;\n    \n    \n    var cg =   _this.set_vbox.cgroup;\n    // what's the sleected target?\n    // update the list..\n    // if ftype is a dir == then toggle all the bellow.\n    \n    if (ftype == \"dir\") {\n        _this.files_tree_store.updateDir(fn,  ((bool) val) ? false :true);\n    }\n    \n    // if ftype is a file .. see if all the files in that directory are check and check the dir.\n\n     \n    if ((bool)val) {\n        // renive\n        cg.sources.remove(fn);\n    } else {\n        cg.sources.add(fn);\n    }\n    \n}"
408                  },
409                  "id" : "files_render_use",
410                  "xtype" : "CellRendererToggle",
411                  "* pack" : "pack_start,false",
412                  "$ xns" : "Gtk",
413                  "gboolean activatable" : true
414                 }
415                ]
416               }
417              ]
418             }
419            ]
420           }
421          ]
422         }
423        ]
424       }
425      ]
426     }
427    ]
428   }
429  ]
430 }