return true;
}
- if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button.button != 3) {
- print("click" + ev.type);
+ if (ev.button.button != 3) {
+ print("click" + ev.button.button);
return false;
}
// returns a cairo surface
var pix = this.el.create_row_drag_icon ( path);
- Gtk.drag_set_icon_surface (ctx, pix);
+ if (Gtk.drag_set_icon_surface) {
+ Gtk.drag_set_icon_surface( ctx, pix );
+ } else {
+ Gtk.drag_set_icon_pixmap (ctx,
+ pix.get_colormap(), pix, null, -10, -10);
+ }
return true;
},
listeners : {
activate : function (self) {
- var tree = this.get('/LeftTree');
- var model = this.get('/LeftTree.model');
- var el = tree.getActivePath();
- print(el);
- var js = model.toJS(el, false);
+ var tree = this.get('/LeftTree');
+ var model = this.get('/LeftTree.model');
+ var el = tree.getActivePath();
+ print(el);
+ var js = model.toJS(el, false);
// print(JSON.stringify(js[0], null,4));
- this.get('/DialogSaveTemplate').show(JSON.stringify(js[0], null,4));
+ this.get('/DialogSaveTemplate').show(JSON.stringify(js[0], null,4));
}
}
// right click.
- if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button.button == 3) {
+ if (ev.button.button == 3) {
// show popup!.
if (res.column.title == 'value' && this.get('/LeftPanel').editing) {
return false;
this.load(data);
- this.get('/LeftTree.model').changed(data, true);
+
+
+ this.get('/LeftTree.model').setFromNode(false,this.toJS());
+ this.get('/LeftTree.model').changed(true);
+
},
getIterValue : function(iter, col) {
},
edited : function (self, object, p0) {
- print("CHANGED VALUE:" + JSON.stringify(p0, null,4));
- return;
+ //print("CHANGED VALUE:" + JSON.stringify(p0, null,4));
+ // return;
var model = this.get('/LeftPanel.model');
- var path = model.activePath;
- var iret = {};
- model.el.get_iter(iret, new Gtk.TreePath.from_string(path));
- model.el.set_value(iret.iter, 0, p0);
- model.el.set_value(iret.iter, 2, p0);
+ var path = model.activePath;
+ var iret = {};
+ model.el.get_iter(iret, new Gtk.TreePath.from_string(path));
+ model.el.set_value(iret.iter, 0, p0);
+ model.el.set_value(iret.iter, 2, p0);
model.activePath = false;
-
- this.get('/LeftTree.model').changed(model.toJS(), true);
- this.el.editable = false;
+ this.get('/LeftTree.model').setFromNode(false,model.toJS());
+ this.get('/LeftTree.model').changed(true);
+
+ this.el.editable = false;
}
}
}
var pix = this.el.create_row_drag_icon ( path);
-
+ print(pix);
if (Gtk.drag_set_icon_surface) {
Gtk.drag_set_icon_surface( ctx, pix );
} else {
- Gtk.drag_set_icon_pixmap (ctx, pix.get_colormap(), pix, null, ..... )
+ Gtk.drag_set_icon_pixmap (ctx,
+ pix.get_colormap(), pix, null, -10, -10);
}
var value = ''+ this.get('/RightPalete.model').el.get_value(iret.iter, 0).value.get_string();