From 470a25819b16effc4d47faeb2de6d4bb836ef587 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 6 Nov 2024 13:18:21 +0100 Subject: [PATCH] make it display LCD with gtk+-3.0 --- src/x49gpng/ui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/x49gpng/ui.c b/src/x49gpng/ui.c index c4eb24d..99bd8d5 100644 --- a/src/x49gpng/ui.c +++ b/src/x49gpng/ui.c @@ -1858,7 +1858,11 @@ static int ui_load( x49gp_module_t* module, GKeyFile* keyfile ) ui->lcd_canvas = gtk_drawing_area_new(); gtk_widget_set_size_request( ui->lcd_canvas, ui->lcd_width, ui->lcd_height ); +#if GTK_MAJOR_VERSION == 2 g_signal_connect( G_OBJECT( ui->lcd_canvas ), "expose-event", G_CALLBACK( redraw_lcd ), x49gp ); +#elif GTK_MAJOR_VERSION == 3 + g_signal_connect( G_OBJECT( ui->lcd_canvas ), "draw", G_CALLBACK( redraw_lcd ), x49gp ); +#endif g_signal_connect( G_OBJECT( ui->lcd_canvas ), "configure-event", G_CALLBACK( draw_lcd ), x49gp ); gtk_event_box_set_visible_window( GTK_EVENT_BOX( lcd_canvas_container ), true );