From 6c1bf7aabd859c27f26898ead8572dd00f419d57 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 9 Aug 2014 10:33:38 -0400 Subject: Big change: with the current event model, it's safe to call Area.RepaintAll() (and the future Area.Repaint()) from within AreaHandler.Key() and AreaHandler.Mouse(); get rid of the bool returns from each. The future Area.Repaint() is important; the bool returns repainted the whole Area, which may not be optimal. --- redo/area_unix.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'redo/area_unix.go') diff --git a/redo/area_unix.go b/redo/area_unix.go index 8b96ff0..3a6ce68 100644 --- a/redo/area_unix.go +++ b/redo/area_unix.go @@ -190,10 +190,7 @@ func finishMouseEvent(widget *C.GtkWidget, data C.gpointer, me MouseEvent, mb ui if me.Up >= 8 { me.Up -= 4 } - repaint := a.handler.Mouse(me) - if repaint { - C.gtk_widget_queue_draw(widget) - } + a.handler.Mouse(me) } // convenience name to make our intent clear @@ -298,10 +295,7 @@ func doKeyEvent(widget *C.GtkWidget, event *C.GdkEvent, data C.gpointer, up bool return } ke.Up = up - repaint := a.handler.Key(ke) - if repaint { - C.gtk_widget_queue_draw(widget) - } + a.handler.Key(ke) } //export our_area_key_press_event_callback -- cgit v1.2.3