[gnome-sudoku/arnaudb/wip/gtk4: 28/33] Make keyboard start to work.



commit 4028437e53f78779c4996f73c8c78c4ac3f9b4d7
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Apr 17 22:42:34 2020 +0200

    Make keyboard start to work.

 src/sudoku-view.vala | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 596a8b2..620da2a 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -22,7 +22,7 @@
 using Gtk;
 using Gdk;
 
-private class SudokuCellView : DrawingArea
+private class SudokuCellView : Widget
 {
     private double size_ratio = 2;
 
@@ -95,10 +95,15 @@ private class SudokuCellView : DrawingArea
     private EventControllerKey key_controller;      // for keeping in memory
     private GestureClick click_controller;          // for keeping in memory
 
+    private DrawingArea drawing;
+
     construct
     {
         BinLayout layout = new BinLayout ();
         set_layout_manager (layout);
+
+        drawing = new DrawingArea ();
+        drawing.insert_after (this, /* insert first */ null);
     }
 
     public SudokuCellView (int row, int col, ref SudokuGame game)
@@ -109,14 +114,12 @@ private class SudokuCellView : DrawingArea
 
         init_mouse ();
         init_keyboard ();
-        set_draw_func (draw);
+        drawing.set_draw_func (draw);
 
         value = game.board [row, col];
 
         // background_color is set in the SudokuView, as it manages the color of the cells
 
-        can_focus = true;
-
         if (is_fixed && game.mode == GameMode.PLAY)
             return;
 


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