[gnome-mines/arnaudb/wip/gtk4: 9/40] Update EventController thing.




commit 727b8593ed2dd19d62bf13c94485d376c4b796be
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Apr 13 22:54:06 2020 +0200

    Update EventController thing.

 src/minefield-view.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 61595b1..346161e 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -436,9 +436,10 @@ public class MinefieldView : Gtk.Grid
 
     private inline void init_keyboard ()  // called on construct
     {
-        key_controller = new Gtk.EventControllerKey (this);
+        key_controller = new Gtk.EventControllerKey ();
         key_controller.key_pressed.connect (on_key_pressed);
         key_controller.key_released.connect (on_key_released);
+        add_controller (key_controller);
     }
 
     private inline bool on_key_pressed (Gtk.EventControllerKey _key_controller, uint keyval, uint keycode, 
Gdk.ModifierType state)


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