Set the confirm of quit
This commit is contained in:
@@ -153,5 +153,31 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
gtk_widget_destroy(dialog); // implicitly hides dialog
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_ABOUT:
|
||||
{
|
||||
// dlg to confirm the quit event :
|
||||
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("About",
|
||||
NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_YES, GTK_RESPONSE_YES,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
NULL);
|
||||
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn?");
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||
|
||||
gtk_widget_show(p_label);
|
||||
int32_t result = gtk_dialog_run (GTK_DIALOG (p_dialog));
|
||||
gtk_widget_destroy(p_dialog);
|
||||
switch (result)
|
||||
{
|
||||
case GTK_RESPONSE_YES:
|
||||
gtk_main_quit();
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user