summaryrefslogtreecommitdiff
path: root/ldmicro/ldmicro.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/ldmicro.cpp')
-rw-r--r--ldmicro/ldmicro.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index 700e490..cfd25da 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -66,7 +66,7 @@ char CurrentCompileFile[MAX_PATH];
PlcProgram Prog;
/// Function to safely quit program gtk main loop
-void LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data);
+gboolean LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data);
//-----------------------------------------------------------------------------
// Get a filename with a common dialog box and then save the program to that
@@ -699,13 +699,14 @@ gboolean LD_WM_KeyDown_call(GtkWidget *widget, GdkEventKey *event, gpointer user
return FALSE;
}
-void LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+gboolean LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
/* Handles:
* WM_CLOSE
*/
- CheckSaveUserCancels();
+ if(CheckSaveUserCancels())
+ return TRUE;
FreezeWindowPos(MainWindow);
FreezeDWORD(IoListHeight);
@@ -881,13 +882,15 @@ void LD_WM_Destroy_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
/* Handles:
* WM_DESTROY
*/
-
+ g_print("destroy called\n");
CheckSaveUserCancels();
+ return;
FreezeWindowPos(MainWindow);
FreezeDWORD(IoListHeight);
gtk_main_quit();
+ gdk_threads_leave();
}
gboolean LD_WM_Size_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
@@ -1342,6 +1345,5 @@ int main(int argc, char** argv)
// }
gtk_main();
- gdk_threads_leave();
return EXIT_SUCCESS;
} \ No newline at end of file