[gnome-tetravex/arnaudb/wip/gtk4: 41/60] Adapt to GtkDrawingArea API.




commit eff37fc9f12511fe44b39e0b8e661542c47dd695
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Feb 21 04:13:24 2020 +0100

    Adapt to GtkDrawingArea API.

 src/puzzle-view.vala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/puzzle-view.vala b/src/puzzle-view.vala
index 98aad31..a9fe522 100644
--- a/src/puzzle-view.vala
+++ b/src/puzzle-view.vala
@@ -195,6 +195,7 @@ private class PuzzleView : Gtk.DrawingArea
     {
         init_mouse ();
         init_keyboard ();
+        set_draw_func (draw);
         size_allocate.connect (on_size_allocate);
 
         animation_timer.start ();
@@ -417,10 +418,10 @@ private class PuzzleView : Gtk.DrawingArea
         socket_pattern = new Cairo.Pattern.for_surface (tmp_surface);
     }
 
-    protected override bool draw (Cairo.Context context)
+    private void draw (Gtk.DrawingArea _this, Cairo.Context context, int width, int height)
     {
         if (!puzzle_init_done)
-            return false;
+            return;
 
         if (arrow_pattern == null || socket_pattern == null || render_size != tilesize)
             init_patterns (context);
@@ -496,8 +497,6 @@ private class PuzzleView : Gtk.DrawingArea
         /* Draw pause overlay */
         if (puzzle.paused)
             draw_pause_overlay (context);
-
-        return false;
     }
     private void draw_image (Cairo.Context context, TileImage image)
     {


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