summaryrefslogtreecommitdiff
path: root/ldmicro
diff options
context:
space:
mode:
authorRr422018-06-29 19:41:09 +0530
committerRr422018-06-29 19:41:09 +0530
commitc263989e44c4a6449787552ece3de72303dd1818 (patch)
treef10960fd1cf03c0786b018fc8fe05fadd7612a88 /ldmicro
parent8511fc6e87d515c2e4a1fbaa2e65f22d844b4a16 (diff)
downloadLDMicroGtk-c263989e44c4a6449787552ece3de72303dd1818.tar.gz
LDMicroGtk-c263989e44c4a6449787552ece3de72303dd1818.tar.bz2
LDMicroGtk-c263989e44c4a6449787552ece3de72303dd1818.zip
Patch: Fixes bug where the save dialog cancel button did not work.
Diffstat (limited to 'ldmicro')
-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