"button_press_event" : " ( event) => {\n\n //\tif (!this.get('/Editor').save()) {\n //\t // popup!! - click handled.. \n// \t return true;\n// }\n return false;\n}",
"drag_begin" : " ( ctx) => {\n // we could fill this in now...\n// Seed.print('SOURCE: drag-begin');\n \n \n \n Gtk.TreeIter iter;\n var s = this.el.get_selection();\n \n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n var path = mod.get_path(iter);\n \n /// pix is a surface..\n var pix = this.el.create_row_drag_icon ( path);\n \n \n Gtk.drag_set_icon_surface (ctx, pix);\n GLib.Value value;\n \n\n _this.model.el.get_value(iter, 0, out value);\n \n this.dragData = (string) value;\n \n \n return;\n}",
"drag_end" : "( drag_context) => {\n \t print(\"SOURCE: drag-end\\n\");\n\t\n\tthis.dragData = \"\";\n\t//this.dropList = null;\n\t_this.drag_end(); // call signal..\n\t//this.get('/LeftTree.view').highlight(false);\n\t \n}",
- "drag_data_get" : " (drag_context, selection_data, info, time) => {\n \t//Seed.print('Palete: drag-data-get: ' + target_type);\n if (this.dragData.length > 0 ) {\n print(\"setting drag data to %s\\n\", this.dragData);\n selection_data.set_text(this.dragData ,this.dragData.length);\n }\n \n \n //this.el.dragData = \"TEST from source widget\";\n \n \n}"
+ "drag_data_get" : " (drag_context, selection_data, info, time) => {\n \t//Seed.print('Palete: drag-data-get: ' + target_type);\n if (this.dragData.length < 1 ) {\n return; \n }\n \n print(\"setting drag data to %s\\n\", this.dragData);\n // selection_data.set_text(this.dragData ,this.dragData.length);\n dataselectiondata.set (selection.get_target (), 8, (uchar[]) this.dragData.to_utf8 ());\n }\n \n \n //this.el.dragData = \"TEST from source widget\";\n \n \n}"
},
"# string dragData" : "",
"* init" : " {\n this.el.set_size_request(150,-1);\n // set_reorderable: [1]\n \n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.modify_font(description);\n \n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n // this.selection.signal['changed'].connect(function() {\n // _view.listeners['cursor-changed'].apply(_view, [ _view, '']);\n //});\n // see: http://live.gnome.org/GnomeLove/DragNDropTutorial\n \n Gtk.drag_source_set (\n this.el, /* widget will be drag-able */\n Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */\n Builder4.Application.targetList, /* lists of target to support */\n Gdk.DragAction.COPY /* what to do with data after dropped */\n );\n //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);\n \n // Gtk.drag_source_set_target_list(this.el, Application.targetList);\n // Gtk.drag_source_add_text_targets(this.el); \n \n}\n",
});
this.el.drag_data_get.connect( (drag_context, selection_data, info, time) => {
//Seed.print('Palete: drag-data-get: ' + target_type);
- if (this.dragData.length > 0 ) {
+ if (this.dragData.length < 1 ) {
+ return;
+ }
+
print("setting drag data to %s\n", this.dragData);
- selection_data.set_text(this.dragData ,this.dragData.length);
+ // selection_data.set_text(this.dragData ,this.dragData.length);
+ dataselectiondata.set (selection.get_target (), 8, (uchar[]) this.dragData.to_utf8 ());
}