added dialog
[gpiv.git] / src / dialog.c
blobfa66551f1725968886e4c0ad43e45172a0bba747
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.
8 Copyright (C) 2002, 2003, 2004 Gerber van der Graaf
10 This file is part of gpiv.
12 Gpiv is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2, or (at your option)
15 any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 ----------------------------------------------------------------------*/
29 * (Callback) functions for dialogs
30 * $Id: dialog.c,v 1.1 2008-09-16 11:20:18 gerber Exp $
32 #ifdef HAVE_CONFIG_H
33 # include <config.h>
34 #endif
35 #include "support.h"
36 #include "gpiv_gui.h"
40 void
41 on_button_quit_gpiv_clicked (GtkDialog *dialog,
42 gint response,
43 gpointer data
45 /*-----------------------------------------------------------------------------
46 * exit, message dialog callbacks
49 g_assert( response == GTK_RESPONSE_ACCEPT
50 || response == GTK_RESPONSE_REJECT);
52 switch (response) {
53 case GTK_RESPONSE_ACCEPT:
54 free_all_bufmems(display_act);
55 gtk_main_quit();
56 break;
58 case GTK_RESPONSE_REJECT:
59 gtk_widget_destroy(GTK_WIDGET (dialog));
60 break;
62 default:
63 g_warning("on_button_quit_gpiv_clicked: should not arrive here");
64 break;
70 void
71 on_close_buffer_response (GtkDialog *dialog,
72 gint response,
73 gpointer data
75 /*-----------------------------------------------------------------------------
78 GpivConsole *gpiv = gtk_object_get_data (GTK_OBJECT(dialog), "gpiv");
79 Display *disp = gtk_object_get_data (GTK_OBJECT(dialog), "display");
82 g_assert ( response == GTK_RESPONSE_ACCEPT
83 || response == GTK_RESPONSE_REJECT);
85 /* g_message ("on_close_buffer_response:: id = %d", */
86 /* display_act->id); */
88 switch (response) {
89 case GTK_RESPONSE_ACCEPT:
92 * Deleting buffer and data
94 close_buffer (gpiv, disp/* , row */);
95 break;
97 case GTK_RESPONSE_REJECT:
99 * No action; just keep buffer with (unstored) data
101 break;
103 default:
104 g_warning("on_close_buffer_response: should not arrive here");
105 break;
108 /* g_message ("on_close_buffer_response:: FINISHED"); */