[gnome-mahjongg/arnaudb/wip/gtk4: 9/18] Adapt to DrawingArea API.



commit 2c4b022419bc04373d20bb14fedd209629ee37e2
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Mar 27 18:59:02 2020 +0100

    Adapt to DrawingArea API.

 src/game-view.vala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index e221d0c..d6933ef 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -50,6 +50,8 @@ public class GameView : Gtk.DrawingArea
         can_focus = true;
 
         init_mouse ();
+
+        set_draw_func (draw);
     }
 
     public void set_background (string? colour)
@@ -267,16 +269,14 @@ public class GameView : Gtk.DrawingArea
         queue_draw ();
     }
 
-    public override bool draw (Cairo.Context cr)
+    private void draw (Gtk.DrawingArea _this, Cairo.Context cr, int new_width, int new_height)
     {
         if (game == null)
-            return false;
+            return;
 
         Gdk.cairo_set_source_rgba (cr, background_color);
         cr.paint ();
         draw_game (cr);
-
-        return true;
     }
 
     private void init_mouse ()


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