[gnome-mahjongg/arnaudb/wip/gtk4: 7/24] Adapt to DrawingArea API.




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

    Adapt to DrawingArea API.

 src/game-view.vala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 50cbbf4..043a0ce 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -101,6 +101,7 @@ public class GameView : Gtk.DrawingArea
         can_focus = true;
         theme_timer_id = 0;
         init_mouse ();
+        set_draw_func (draw);
         size_allocate.connect(() => {
             /* Recalculate dimensions */
             update_dimensions ();
@@ -302,16 +303,14 @@ public class GameView : Gtk.DrawingArea
         queue_draw ();
     }
 
-    public override bool draw (Cairo.Context cr)
+    private inline 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 inline void init_mouse ()


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