[pygobject/wip/jfelder/gtk4-toolbutton] tests: Fix gtk_drag_methods method for Gtk4



commit 3ee9d9bc0372c99aafea2f56b555b61913c727d2
Author: Jean Felder <jean felder gmail com>
Date:   Mon Mar 16 21:21:15 2020 +0100

    tests: Fix gtk_drag_methods method for Gtk4

 tests/test_overrides_gtk.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 6bf9350f..0412cd7e 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -664,17 +664,18 @@ class TestGtk(unittest.TestCase):
         widget.drag_check_threshold(0, 0, 0, 0)
 
         # drag_dest_ methods
-        widget.drag_dest_set(Gtk.DestDefaults.DROP, None, Gdk.DragAction.COPY)
-        widget.drag_dest_add_image_targets()
-        widget.drag_dest_add_text_targets()
-        widget.drag_dest_add_uri_targets()
-        widget.drag_dest_get_track_motion()
-        widget.drag_dest_set_track_motion(True)
-        widget.drag_dest_get_target_list()
-        widget.drag_dest_set_target_list(None)
+        # widget.drag_dest_add_image_targets()
+        # widget.drag_dest_add_text_targets()
+        # widget.drag_dest_add_uri_targets()
+        # widget.drag_dest_get_track_motion()
+        # widget.drag_dest_set_track_motion(True)
+        # widget.drag_dest_get_target_list()
+        # widget.drag_dest_set_target_list(None)
         if GTK4:
-            widget.drag_dest_set_target_list(Gdk.ContentFormats.new([]))
+            drop_target = Gtk.DropTarget.new(Gdk.ContentFormats.new([]), Gdk.DragAction.COPY)
+            widget.add_controller(drop_target)
         else:
+            widget.drag_dest_set(Gtk.DestDefaults.DROP, None, Gdk.DragAction.COPY)
             widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry.new('test', 0, 0)]))
         widget.drag_dest_unset()
 


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