[gnome-mahjongg/arnaudb/wip/gtk4: 11/29] Adapt to DrawingArea API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg/arnaudb/wip/gtk4: 11/29] Adapt to DrawingArea API.
- Date: Fri, 9 Oct 2020 15:35:06 +0000 (UTC)
commit fbb89c7e21624869174f44ac56c1044a47e4cbce
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]