[gnome-nibbles/arnaudb/wip/gtk4: 149/188] Adapt to GtkEventController API.




commit d6c511941ddc6c7f6b6e50f14e4ad008e4232cd6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat May 30 18:44:55 2020 +0200

    Adapt to GtkEventController API.

 src/nibbles-window.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 42cfa67..441589e 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -130,8 +130,9 @@ private class NibblesWindow : ApplicationWindow
         if (settings.get_boolean ("window-is-maximized"))
             maximize ();
 
-        key_controller = new EventControllerKey (this);
+        key_controller = new EventControllerKey ();
         key_controller.key_pressed.connect (key_press_event_cb);
+        ((Widget) this).add_controller (key_controller);
 
         /* Create game */
         game = new NibblesGame (start_level,


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