[gnome-mahjongg/arnaudb/wip/gtk4: 10/23] Adapt to DrawingArea API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg/arnaudb/wip/gtk4: 10/23] Adapt to DrawingArea API.
- Date: Sun, 3 May 2020 16:22:50 +0000 (UTC)
commit d1b9f97f8a494e4ee2d8d58dba9a8faced6765ee
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 810bd78..1d37b57 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -100,6 +100,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 ();
@@ -301,16 +302,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 inline void init_mouse ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]