[gnome-mahjongg/arnaudb/wip/gtk4: 13/27] Adapt to DrawingArea API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg/arnaudb/wip/gtk4: 13/27] Adapt to DrawingArea API.
- Date: Sat, 25 Apr 2020 11:53:01 +0000 (UTC)
commit c99a254dfacbbed3e2f0a1a489b54867a6861e38
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]