From 252f21ab1f1639a1e936fe0e7b77975b40a0df7a Mon Sep 17 00:00:00 2001 From: akshay-c Date: Fri, 18 Jan 2019 12:20:34 +0530 Subject: Improve timer/counter dialog close events --- ldmicro/simpledialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp index 864189b..65a5c43 100644 --- a/ldmicro/simpledialog.cpp +++ b/ldmicro/simpledialog.cpp @@ -93,6 +93,14 @@ static void MyAlnumOnlyProc (GtkEditable *editable, gchar *NewText, gint length, // oops(); } + +//Set the closing parameters + +gboolean SimpleDialogClosing(GtkWidget *widget, GdkEvent *event, gpointer user_data) +{ + SIMPLE_DIALOG_ACTIVE = FALSE; +} + //----------------------------------------------------------------------------- // Don't allow any characters other than -0-9. in the box. //----------------------------------------------------------------------------- @@ -378,6 +386,7 @@ void ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask, g_signal_connect (CancelButton, "clicked", G_CALLBACK (SimpleDialogCancelProc), NULL); g_signal_connect (OkButton, "clicked", G_CALLBACK (SimpleDialogWrapUp), NULL); g_signal_connect (SimpleDialog, "key_press_event", G_CALLBACK (SimpleDialogKeyPressProc), NULL); + g_signal_connect (SimpleDialog, "destroy_event", G_CALLBACK (SimpleDialogClosing), NULL); // EnableWindow(MainWindow, FALSE); // ShowWindow(SimpleDialog, TRUE); -- cgit