diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-09-10 06:53:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-09-10 06:53:32 +0000 |
commit | 046c060f989cdd51791c2112c1103f858ceeadf4 (patch) | |
tree | 2ad3d562ab8c51ee36eec5f31f5bf13f3180febb /gtk/print_prefs.c | |
parent | 7e1ce9e12207a0601d329e7147a5bca1eb5a22b6 (diff) | |
download | wireshark-046c060f989cdd51791c2112c1103f858ceeadf4.tar.gz |
We need to catch a "window delete" event for the preferences dialog box
- that event happens if, say, you nuke the dialog box from a window
manager - and call "delete" routines for each of the preferences tabs,
so that, for preferences tabs that include list widgets, we can set a
flag on the preferences tab widget telling the selection callback for
the list widget that the buttons it would normally set the sensitivity
of, based on whether any row in the list is selected or not, have Joined
the Choir Invisible, and therefore that we shouldn't change their
sensitivity because GTK+ will whine at us if we do, just as is the case
if we press the "OK" or "Cancel" button (which also cause the window to
go away).
Can we just do this in the "window delete" handler? I.e., does that get
called if we explicitly destroy the widget? Or should we catch a
"destroy" event instead?
(There must be a better way to do this....)
svn path=/trunk/; revision=647
Diffstat (limited to 'gtk/print_prefs.c')
-rw-r--r-- | gtk/print_prefs.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/gtk/print_prefs.c b/gtk/print_prefs.c index 7261726462..e05f41f912 100644 --- a/gtk/print_prefs.c +++ b/gtk/print_prefs.c @@ -1,7 +1,7 @@ /* print_prefs.c * Dialog boxes for preferences for printing * - * $Id: print_prefs.c,v 1.3 1999/09/09 04:25:48 guy Exp $ + * $Id: print_prefs.c,v 1.4 1999/09/10 06:53:31 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -33,6 +33,8 @@ #include "globals.h" #endif +#include "print_prefs.h" + #ifndef __KEYS_H__ #include "keys.h" #endif @@ -208,6 +210,8 @@ printer_prefs_ok(GtkWidget *w) prefs.pr_file = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_object_get_data(GTK_OBJECT(w), PRINT_FILE_TE_KEY)))); + + printer_prefs_delete(w); } void @@ -219,29 +223,34 @@ printer_prefs_save(GtkWidget *w) void printer_prefs_cancel(GtkWidget *w) { + printer_prefs_delete(w); +} + +void +printer_prefs_delete(GtkWidget *w) +{ } static void printer_opts_toggle_format(GtkWidget *widget, gpointer data) { - if (GTK_TOGGLE_BUTTON (widget)->active) { - prefs.pr_format = PR_FMT_PS; - /* toggle file/cmd */ - } - else { - prefs.pr_format = PR_FMT_TEXT; - /* toggle file/cmd */ - } + if (GTK_TOGGLE_BUTTON (widget)->active) { + prefs.pr_format = PR_FMT_PS; + /* toggle file/cmd */ + } + else { + prefs.pr_format = PR_FMT_TEXT; + /* toggle file/cmd */ + } } static void printer_opts_toggle_dest(GtkWidget *widget, gpointer data) { - if (GTK_TOGGLE_BUTTON (widget)->active) { - prefs.pr_dest = PR_DEST_FILE; - } - else { - prefs.pr_dest = PR_DEST_CMD; - } + if (GTK_TOGGLE_BUTTON (widget)->active) { + prefs.pr_dest = PR_DEST_FILE; + } + else { + prefs.pr_dest = PR_DEST_CMD; + } } - |