updated copyright statement
[gpiv.git] / src / dialog.c
blobfcc34ce90f1d240f2df84516511d79f7f134784c
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
6 libraries.
9 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
10 Gerber van der Graaf
12 This file is part of gpiv.
14 Gpiv is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2, or (at your option)
17 any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 ----------------------------------------------------------------------*/
31 * (Callback) functions for dialogs
32 * $Id: dialog.c,v 1.1 2008-09-16 11:20:18 gerber Exp $
34 #ifdef HAVE_CONFIG_H
35 # include <config.h>
36 #endif
37 #include "support.h"
38 #include "gpiv_gui.h"
42 void
43 on_button_quit_gpiv_clicked (GtkDialog *dialog,
44 gint response,
45 gpointer data
47 /*-----------------------------------------------------------------------------
48 * exit, message dialog callbacks
51 g_assert( response == GTK_RESPONSE_ACCEPT
52 || response == GTK_RESPONSE_REJECT);
54 switch (response) {
55 case GTK_RESPONSE_ACCEPT:
56 free_all_bufmems(display_act);
57 gtk_main_quit();
58 break;
60 case GTK_RESPONSE_REJECT:
61 gtk_widget_destroy(GTK_WIDGET (dialog));
62 break;
64 default:
65 g_warning("on_button_quit_gpiv_clicked: should not arrive here");
66 break;
72 void
73 on_close_buffer_response (GtkDialog *dialog,
74 gint response,
75 gpointer data
77 /*-----------------------------------------------------------------------------
80 GpivConsole *gpiv = gtk_object_get_data (GTK_OBJECT(dialog), "gpiv");
81 Display *disp = gtk_object_get_data (GTK_OBJECT(dialog), "display");
84 g_assert ( response == GTK_RESPONSE_ACCEPT
85 || response == GTK_RESPONSE_REJECT);
87 /* g_message ("on_close_buffer_response:: id = %d", */
88 /* display_act->id); */
90 switch (response) {
91 case GTK_RESPONSE_ACCEPT:
94 * Deleting buffer and data
96 close_buffer (gpiv, disp/* , row */);
97 break;
99 case GTK_RESPONSE_REJECT:
101 * No action; just keep buffer with (unstored) data
103 break;
105 default:
106 g_warning("on_close_buffer_response: should not arrive here");
107 break;
110 /* g_message ("on_close_buffer_response:: FINISHED"); */