GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::TreeDragSource Class Reference

A GtkTreeDragSource C++ wrapper class. More...

#include <gfc/gtk/treednd.hh>

Inheritance diagram for GFC::Gtk::TreeDragSource:

GFC::G::TypeInterface GFC::G::TypeInstance GFC::Trackable GFC::Gtk::ListStore GFC::Gtk::TreeModelFilter GFC::Gtk::TreeModelSort GFC::Gtk::TreeStore List of all members.

Public Member Functions

Accessors
Methods

Protected Member Functions

Constructors

Detailed Description

A GtkTreeDragSource C++ wrapper class.

GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level API.

The low-level API consists of the GTK+ DND API, augmented by some treeview utility functions: Gtk::TreeView::set_drag_dest_row(), Gtk::TreeView::get_drag_dest_row(), Gtk::TreeView::get_dest_row_at_pos() and Gtk::TreeView::create_row_drag_icon(). This API leaves a lot of flexibility, but nothing is done automatically, and implementing advanced features like hover-to-open-rows or autoscrolling on top of this API is a lot of work.

On the other hand, if you write to the high-level TreeDragSource and TreeDragDest API, then all the bookkeeping of rows is done for you, as well as things like hover-to-open and auto-scroll. The TreeDragSource interface is implemented by Gtk::TreeModelSort, Gtk::TreeStore, Gtk::ListStore and Gtk::TreeModelFilter. The TreeDragDest interface is implemented by Gtk::TreeStore and Gtk::ListStore.


Member Function Documentation

bool GFC::Gtk::TreeDragSource::drag_data_delete TreePath path  ) 
 

Asks the TreeDragSource to delete the row at path, because it was moved somewhere else via drag-and-drop.

Parameters:
path The row that was being dragged.
Returns:
true if the row was successfully deleted.

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!

bool GFC::Gtk::TreeDragSource::drag_data_get const TreePath path,
SelectionData selection_data
 

Asks the TreeDragSource to fill in selection_data with a representation of the row at path.

Parameters:
path The row that was dragged.
selection_data A Gtk::SelectionData to fill with data from the dragged row
Returns:
true if data of the required type was provided.

Note, selection_data->get_target() gives the required type of the data. Should robustly handle a path no longer found in the model!

bool GFC::Gtk::TreeDragSource::row_draggable const TreePath path  )  const
 

Determines whether a particular row can be used as the source of a DND operation.

Parameters:
path The row on which user is initiating a drag.
Returns:
true if the row can be dragged.

If the source doesn't implement this interface, the row is assumed draggable.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:43 2004 for GFC-UI by doxygen 1.3.8