Revision [32949]
This is an old revision of gtkdialogDocTips9.7 made by zigbert on 2020-08-02 23:05:19.
9.7 Drag'n drop
Gtkdialog has limited support for drag'n drop. This is what we've learnt by now:Drag from file browser to <entry> widget.
export test=" <entry> <default>Drag a directory from Rox</default> </entry>" gtkdialog -p test
Move items in list by drag'n drop. (More info in this thread)
Using the reorderable option in the <tree> has some strange behavior. For example will items get swallowed when moving them onto another item. The workaround restores the list if the user moves item onto, instead of in between 2 other items... This code by MochiMoppel is a result of 2 cracked nuts:
- When moving an item in the list the $PTR_Y variable returns 0. A return value >0 gives us the info that the user is clicking rather than moving.
- Normally <action> defined for a widget are processed before built-in actions. The trick is to process a user defined <action> after a built-in action. An invisible button allows the code to run a user defined save action after a built-in reorder action.