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



commit 936b6b89a2ee72e10c344f2c941632dc1b9873a2
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 | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 6bf9350f..f1fcddef 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -664,17 +664,19 @@ 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:
+            drop_target = Gtk.DropTarget()
+            widget.add_controller(drop_target)
             widget.drag_dest_set_target_list(Gdk.ContentFormats.new([]))
         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]