From: John Darrington Date: Mon, 19 Jun 2023 18:25:59 +0000 (+0200) Subject: Add a callback from PsppireDialog on GtkDrawingArea draw signals. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45fe7b37ff05248c99bbbf79f5fd105364f8ea5c;p=pspp Add a callback from PsppireDialog on GtkDrawingArea draw signals. If a PsppireDialog contains a GtkDrawingArea, potentially any change to the drawn surface could indicate a change in state. Therefore, we need to notify interested parties of this change. --- diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 99f6d22824..d35fcd6021 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -281,11 +281,17 @@ connect_notify_signal (GtkWidget *w, gpointer data) dialog); } - /* It's unfortunate that GTK+ doesn't have a generic "user-modified-state-changed" signal. Instead, we have to try and predict what widgets and signals are likely to exist in our dialogs. */ + if (GTK_IS_DRAWING_AREA (w)) + { + g_signal_connect_swapped (w, "draw", + G_CALLBACK (psppire_dialog_notify_change), + dialog); + } + if (GTK_IS_TOGGLE_BUTTON (w)) { g_signal_connect_swapped (w, "toggled",