2 //<Script type="Text/javascript">
4 XObject = imports.XObject.XObject
6 GObject = imports.gi.GObject;
8 // tree view column.. should really have a better way to determin stuff..
10 GtkTreeView = XObject.define(
15 var clean_cfg = XObject.extend({
22 delete clean_cfg.font;
23 delete clean_cfg.selection;
24 delete clean_cfg.drag_source;
25 delete clean_cfg.drag_dest;
28 XObject.call(this, clean_cfg);
32 // this is an example...
43 XObject.prototype.init.call(this);
49 if (this.config.font) {
50 var description = new Pango.FontDescription.c_new();
51 description.set_size(this.config.font.size);
52 this.el.modify_font(description);
57 if (this.config.drag_source) {
58 var ds = this.config.drag_source;
60 this.el.drag_source_set( // widget will be drag-able
61 ds.modifier, //Gdk.ModifierType.BUTTON1_MASK, // modifier that will start a drag
62 null, // lists of target to support
64 ds.action ////Gdk.DragAction.COPY | Gdk.DragAction.MOVE
65 // what to do with data after dropped
68 this.el.drag_source_set_target_list(
69 ds.targetList // probably imports.Window.targetList;
70 //this.get('/Window').targetList
72 this.el.drag_source_add_text_targets();
75 if (this.config.drag_dest) {
77 var ds = this.config.drag_dest;
81 ds.modifier, // Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,
82 null, // lists of target to support
84 ds.action //Gdk.DragAction.COPY | Gdk.DragAction.MOVE // what to do with data after dropped
87 this.el.drag_source_add_text_targets();
88 this.el.drag_dest_set_target_list(
90 //this.get('/Window').targetList
92 this.el.drag_dest_add_text_targets();
103 GtkTreeView.config = {
104 //selection : { << just need to add a treeselection..
105 // type : 'Gtk.TreeSelection'
108 type : 'Pango.FontDescription'
111 type : 'Gtk.TreeDragSource' // these are realy interfaces...
115 type : 'Gtk.TreeDragDest'