~~~~~testfile.vala.c
[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" : "builder",
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        "* pack" : false,
27        "xtype" : "Label",
28        "$ xns" : "Gtk",
29        "utf8 label" : "Global"
30       },
31       {
32        "id" : "label_targets",
33        "xtype" : "Label",
34        "* pack" : false,
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          "* pack" : "pack_start,false,false,0",
56          "xtype" : "Entry",
57          "$ xns" : "Gtk",
58          "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR "
59         },
60         {
61          "* pack" : "pack_start,true,true,0",
62          "xtype" : "HBox",
63          "$ xns" : "Gtk",
64          "items" : [
65           {
66            "* pack" : "add",
67            "xtype" : "ScrolledWindow",
68            "$ xns" : "Gtk",
69            "items" : [
70             {
71              "gboolean headers_visible" : true,
72              "xtype" : "TreeView",
73              "* pack" : "add",
74              "string id" : "default_packages_tree",
75              "$ xns" : "Gtk",
76              "items" : [
77               {
78                "id" : "default_packages_tree_store",
79                "xtype" : "ListStore",
80                "* pack" : "set_model",
81                "$ n_columns" : 2,
82                "| 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",
83                "$ columns" : "    typeof(string),  // 0 key type\n      typeof(bool)",
84                "$ xns" : "Gtk"
85               },
86               {
87                "utf8 title" : "package name",
88                "* init" : " \n this.el.add_attribute(_this.packages_render.el , \"text\", 0 );\n  ",
89                "* pack" : "append_column",
90                "xtype" : "TreeViewColumn",
91                "gboolean resizable" : true,
92                "gboolean expand" : true,
93                "$ xns" : "Gtk",
94                "items" : [
95                 {
96                  "id" : "packages_render",
97                  "xtype" : "CellRendererText",
98                  "* pack" : "pack_start,false",
99                  "$ xns" : "Gtk"
100                 }
101                ]
102               },
103               {
104                "utf8 title" : "use",
105                "* init" : "{\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n }",
106                "* pack" : "append_column",
107                "xtype" : "TreeViewColumn",
108                "gboolean resizable" : false,
109                "$ xns" : "Gtk",
110                "gint fixed_width" : 50,
111                "items" : [
112                 {
113                  "listeners" : {
114                   "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}"
115                  },
116                  "id" : "packages_render_use",
117                  "* pack" : "pack_start,false",
118                  "xtype" : "CellRendererToggle",
119                  "$ xns" : "Gtk",
120                  "gboolean activatable" : true
121                 }
122                ]
123               }
124              ]
125             }
126            ]
127           },
128           {
129            "* pack" : "add",
130            "xtype" : "ScrolledWindow",
131            "$ xns" : "Gtk",
132            "items" : [
133             {
134              "listeners" : {
135               "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}"
136              },
137              "gboolean headers_visible" : true,
138              "id" : "default_directory_tree",
139              "* pack" : "add",
140              "xtype" : "TreeView",
141              "$ xns" : "Gtk",
142              "items" : [
143               {
144                "id" : "default_directory_tree_store",
145                "xtype" : "ListStore",
146                "* pack" : "set_model",
147                "$ n_columns" : 1,
148                "| 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",
149                "$ columns" : "    typeof(string)\n     ",
150                "$ xns" : "Gtk"
151               },
152               {
153                "utf8 title" : "Available Directories (right click to add)",
154                "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n   ",
155                "* pack" : "append_column",
156                "xtype" : "TreeViewColumn",
157                "gboolean resizable" : true,
158                "$ xns" : "Gtk",
159                "items" : [
160                 {
161                  "id" : "directory_render",
162                  "xtype" : "CellRendererText",
163                  "* pack" : "pack_start,false",
164                  "$ xns" : "Gtk"
165                 }
166                ]
167               }
168              ]
169             },
170             {
171              "id" : "default_directory_menu",
172              "xtype" : "Menu",
173              "$ xns" : "Gtk",
174              "items" : [
175               {
176                "listeners" : {
177                 "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}"
178                },
179                "* pack" : "add",
180                "xtype" : "MenuItem",
181                "$ xns" : "Gtk",
182                "utf8 label" : "Add Directory"
183               },
184               {
185                "listeners" : {
186                 "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}"
187                },
188                "* pack" : "add",
189                "xtype" : "MenuItem",
190                "$ xns" : "Gtk",
191                "utf8 label" : "Add File"
192               },
193               {
194                "* pack" : "add",
195                "xtype" : "SeparatorMenuItem",
196                "$ xns" : "Gtk"
197               },
198               {
199                "listeners" : {
200                 "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}"
201                },
202                "* pack" : "add",
203                "xtype" : "MenuItem",
204                "$ xns" : "Gtk",
205                "utf8 label" : "Remove File/Directory"
206               }
207              ]
208             }
209            ]
210           }
211          ]
212         }
213        ]
214       },
215       {
216        "gint position" : 300,
217        "* pack" : "append_page,_this.label_targets.el",
218        "xtype" : "HPaned",
219        "$ xns" : "Gtk",
220        "items" : [
221         {
222          "* init" : "{  \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
223          "* pack" : "add1",
224          "xtype" : "ScrolledWindow",
225          "$ xns" : "Gtk",
226          "items" : [
227           {
228            "id" : "targets_tree_menu",
229            "xtype" : "Menu",
230            "* pack" : "add",
231            "$ xns" : "Gtk",
232            "items" : [
233             {
234              "listeners" : {
235               "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}"
236              },
237              "* pack" : "add",
238              "xtype" : "MenuItem",
239              "$ xns" : "Gtk",
240              "utf8 label" : "Add Compile Target"
241             },
242             {
243              "* pack" : "add",
244              "xtype" : "SeparatorMenuItem",
245              "$ xns" : "Gtk"
246             },
247             {
248              "listeners" : {
249               "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}"
250              },
251              "* pack" : "add",
252              "xtype" : "MenuItem",
253              "$ xns" : "Gtk",
254              "utf8 label" : "Remove Target"
255             }
256            ]
257           },
258           {
259            "listeners" : {
260             "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}",
261             "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  }"
262            },
263            "id" : "targets_tree",
264            "# string cursor" : "",
265            "* pack" : "add",
266            "xtype" : "TreeView",
267            "$ xns" : "Gtk",
268            "items" : [
269             {
270              "id" : "targets_tree_store",
271              "* pack" : "set_model",
272              "xtype" : "ListStore",
273              "$ n_columns" : 2,
274              "| 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",
275              "$ columns" : "    typeof(string),  // 0 key type\n     typeof(string) // ??\n     ",
276              "$ xns" : "Gtk"
277             },
278             {
279              "utf8 title" : "name",
280              "* init" : " {\n     this.el.add_attribute(_this.targets_render.el , \"text\", 0 );\n }",
281              "* pack" : "append_column",
282              "xtype" : "TreeViewColumn",
283              "gboolean resizable" : true,
284              "$ xns" : "Gtk",
285              "items" : [
286               {
287                "listeners" : {
288                 "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  }"
289                },
290                "id" : "targets_render",
291                "* pack" : "pack_start,false",
292                "xtype" : "CellRendererText",
293                "$ xns" : "Gtk",
294                "gboolean editable" : true
295               }
296              ]
297             }
298            ]
299           }
300          ]
301         },
302         {
303          "id" : "set_vbox",
304          "* pack" : "add2",
305          "xtype" : "VBox",
306          "gboolean homogeneous" : false,
307          "$ xns" : "Gtk",
308          "# Project.GtkValaSettings cgroup" : "null",
309          "items" : [
310           {
311            "xtype" : "Label",
312            "* pack" : "pack_start,false,false,0",
313            "$ xns" : "Gtk",
314            "utf8 label" : "target filename"
315           },
316           {
317            "listeners" : {
318             "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}"
319            },
320            "id" : "build_pack_target",
321            "* pack" : "pack_start,false,false,0",
322            "xtype" : "Entry",
323            "$ xns" : "Gtk"
324           },
325           {
326            "xtype" : "Label",
327            "* pack" : "pack_start,false,false,0",
328            "$ xns" : "Gtk",
329            "utf8 label" : "compile flags"
330           },
331           {
332            "listeners" : {
333             "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}"
334            },
335            "id" : "build_compile_flags",
336            "* pack" : "pack_start,false,false,0",
337            "xtype" : "Entry",
338            "$ xns" : "Gtk"
339           },
340           {
341            "xtype" : "Label",
342            "* pack" : "pack_start,false,false,0",
343            "$ xns" : "Gtk",
344            "utf8 label" : "Files to compile"
345           },
346           {
347            "* pack" : "pack_start,true,true,0",
348            "xtype" : "ScrolledWindow",
349            "$ xns" : "Gtk",
350            "items" : [
351             {
352              "xtype" : "TreeView",
353              "* pack" : "add",
354              "string id" : "files_tree",
355              "$ xns" : "Gtk",
356              "items" : [
357               {
358                "id" : "files_tree_store",
359                "* pack" : "set_model",
360                "xtype" : "ListStore",
361                "| 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",
362                "$ n_columns" : 4,
363                "| 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 ",
364                "$ columns" : "    typeof(string),  // 0 file name\n        typeof(string),  // 0 basename\n     typeof(string), // type (dir orfile)\n     typeof(bool)  // is checked.\n     ",
365                "$ xns" : "Gtk",
366                "| 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"
367               },
368               {
369                "utf8 title" : "name",
370                "* 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*/",
371                "* pack" : "append_column",
372                "xtype" : "TreeViewColumn",
373                "gboolean resizable" : true,
374                "$ xns" : "Gtk",
375                "items" : [
376                 {
377                  "id" : "files_render",
378                  "xtype" : "CellRendererText",
379                  "* pack" : "pack_start,false",
380                  "$ xns" : "Gtk"
381                 }
382                ]
383               },
384               {
385                "utf8 title" : "use",
386                "* init" : "{\n this.el.add_attribute(_this.files_render_use.el , \"active\", 3 );\n }",
387                "* pack" : "append_column",
388                "xtype" : "TreeViewColumn",
389                "gboolean resizable" : false,
390                "$ xns" : "Gtk",
391                "gint fixed_width" : 50,
392                "items" : [
393                 {
394                  "listeners" : {
395                   "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}"
396                  },
397                  "id" : "files_render_use",
398                  "* pack" : "pack_start,false",
399                  "xtype" : "CellRendererToggle",
400                  "$ xns" : "Gtk",
401                  "gboolean activatable" : true
402                 }
403                ]
404               }
405              ]
406             }
407            ]
408           }
409          ]
410         }
411        ]
412       }
413      ]
414     }
415    ]
416   }
417  ]
418 }