TreeDragSourceIF

Members

Functions

dragDataDelete
bool dragDataDelete(TreePath path)

Asks the GtkTreeDragSource to delete the row at path, because it was moved somewhere else via drag-and-drop. Returns FALSE if the deletion fails because path no longer exists, or for some model-specific reason. Should robustly handle a path no longer found in the model!

dragDataGet
bool dragDataGet(TreePath path, SelectionData selectionData)

Asks the GtkTreeDragSource to fill in selection_data with a representation of the row at path. selection_data->target gives the required type of the data. Should robustly handle a path no longer found in the model!

getStruct
void* getStruct()

the main Gtk struct as a void*

getTreeDragSourceStruct
GtkTreeDragSource* getTreeDragSourceStruct(bool transferOwnership)

Get the main Gtk struct

rowDraggable
bool rowDraggable(TreePath path)

Asks the GtkTreeDragSource whether a particular row can be used as the source of a DND operation. If the source doesn’t implement this interface, the row is assumed draggable.

Static functions

getRowDragData
bool getRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path)

Obtains a tree_model and path from selection data of target type GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. This function can only be used if selection_data originates from the same process that’s calling this function, because a pointer to the tree model is being passed around. If you aren’t in the same process, then you'll get memory corruption. In the GtkTreeDragDest drag_data_received handler, you can assume that selection data of type GTK_TREE_MODEL_ROW is in from the current process. The returned path must be freed with TreePath.free.

getType
GType getType()
setRowDragData
bool setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path)

Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used in a drag_data_get handler.