Builder4/ValaProjectSettings.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 19 Nov 2014 12:27:33 +0000 (20:27 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 19 Nov 2014 12:27:33 +0000 (20:27 +0800)
Builder4/ValaProjectSettings.vala

Builder4/ValaProjectSettings.bjs
Builder4/ValaProjectSettings.vala

index c3e6156..ecf28b6 100644 (file)
                                         {
                                             "listeners" : {
                                                 "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}",
-                                                "cursor_changed" : " ( ) => {\n\n    if (this.cursor != \"\") {\n         // save the values..\n     }\n     \n     // load the new values.\n     \n\n\n\n  }"
+                                                "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            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       this.cursor = fn;\n       \n      // _this.default_directory_tree_store.load();\n\n  }"
                                             },
                                             "id" : "targets_tree",
+                                            "# string cursor" : "",
                                             "* pack" : "add",
                                             "xtype" : "TreeView",
                                             "$ xns" : "Gtk",
index 7b9b367..3fb27fd 100644 (file)
@@ -1059,6 +1059,7 @@ public class ValaProjectSettings : Object
 
 
             // my vars (def)
+        public string cursor;
 
         // ctor 
         public Xcls_targets_tree(ValaProjectSettings _owner )
@@ -1112,7 +1113,24 @@ public class ValaProjectSettings : Object
                  // load the new values.
                  
             
+                     Gtk.TreeModel mod;
+                    Gtk.TreeIter iter;
+                    if (!_this.el.get_selection().get_selected(out mod, out iter)) {
+                           print("nothing selected\n");
+                        return;
+                    }
             
+                        
+                   // add the directory..
+                   
+                   
+                   GLib.Value val;
+                    mod.get_value(iter,0, out val);
+                   var fn =  (string) val;
+                   
+                   this.cursor = fn;
+                   
+                  // _this.default_directory_tree_store.load();
             
               });
         }