[gtkmm] Gtk::TreeView: Use the GTK_TYPE_TREE_ROW_DATA GType target



commit cca7ad44871c95055178d6309d509cdf3988f4db
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Feb 8 08:44:12 2021 +0100

    Gtk::TreeView: Use the GTK_TYPE_TREE_ROW_DATA GType target
    
    The enable_model_drag_[source|dest]() overloads without a
    Gdk::ContentFormats parameter shall use the GTK_TYPE_TREE_ROW_DATA
    GType target.

 gtk/src/treeview.ccg | 13 ++-----------
 gtk/src/treeview.hg  | 14 +++++++++-----
 2 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 46bbf56d..f486b46c 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -28,15 +28,6 @@
 
 using GridLines = Gtk::TreeView::GridLines;
 
-namespace
-{
-
-//This target name is used in the GTK+ implementation:
-static const char treeview_target_row[]   = "GTK_TREE_MODEL_ROW";
-
-} // anonymous namespace
-
-
 static void SignalProxy_Mapping_gtk_callback(GtkTreeView* tree_view, GtkTreePath* path, void* data)
 {
   auto the_slot = static_cast<Gtk::TreeView::SlotMapping*>(data);
@@ -129,12 +120,12 @@ void TreeView::get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column)
 
 void TreeView::enable_model_drag_source(Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
 {
-  enable_model_drag_source(Gdk::ContentFormats::create(treeview_target_row), start_button_mask, actions);
+  enable_model_drag_source(Gdk::ContentFormats::create(GTK_TYPE_TREE_ROW_DATA), start_button_mask, actions);
 }
 
 void TreeView::enable_model_drag_dest(Gdk::DragAction actions)
 {
-  enable_model_drag_dest(Gdk::ContentFormats::create(treeview_target_row), actions);
+  enable_model_drag_dest(Gdk::ContentFormats::create(GTK_TYPE_TREE_ROW_DATA), actions);
 }
 
 bool TreeView::get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, 
int& cell_y) const
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 87d37924..facdc25d 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -624,8 +624,10 @@ public:
     Gdk::DragAction actions{.} = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
     gtk_tree_view_enable_model_drag_source)
 
-  /** Turns the TreeView into a drag source for automatic DND.
-   * Uses the default "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
+  /** Turns the %TreeView into a drag source for automatic DND.
+   *
+   * Calling this method sets property_reorderable() to <tt>false</tt>.
+   * Uses the GTK_TYPE_TREE_ROW_DATA GType target, which the %TreeView can handle automatically.
    *
    * @param start_button_mask Mask of allowed buttons to start drag.
    * @param actions The bitmask of possible actions for a drag from this widget.
@@ -637,10 +639,12 @@ public:
     Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
     gtk_tree_view_enable_model_drag_dest)
 
-  /** Turns the TreeView into a drop destination for automatic DND.  This uses the default
-   *  "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
+  /** Turns the %TreeView into a drop destination for automatic DND.
    *
-   * @param actions The bitmask of possible actions for a drag from this widget.
+   * Calling this method sets property_reorderable() to <tt>false</tt>.
+   * Uses the GTK_TYPE_TREE_ROW_DATA GType target, which the %TreeView can handle automatically.
+   *
+   * @param actions The bitmask of possible actions for a drag to this widget.
    */
   void enable_model_drag_dest(Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]