From: John Darrington Date: Sat, 27 Jan 2007 00:56:29 +0000 (+0000) Subject: Fixed bug closing variable type dialog X-Git-Tag: v0.6.0~575 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6af00e4a134d1ae496a68a0fbe0d3c4fcaaea88a;p=pspp-builds.git Fixed bug closing variable type dialog --- diff --git a/src/ui/gui/ChangeLog b/src/ui/gui/ChangeLog index 5b0dbec4..0d5825a6 100644 --- a/src/ui/gui/ChangeLog +++ b/src/ui/gui/ChangeLog @@ -1,3 +1,8 @@ +Sat Jan 27 09:48:21 WST 2007 John Darrington + + * var-type-dialog.c: Fixed bugs closing window, apparent when compiled + against gtk.2.10 + Fri Jan 26 15:51:34 WST 2007 John Darrington * psppire-var-select.c psppire-var-select.h : Deleted. diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c index d3eb97ed..d64b8129 100644 --- a/src/ui/gui/var-type-dialog.c +++ b/src/ui/gui/var-type-dialog.c @@ -207,8 +207,8 @@ on_toggle_2 (GtkToggleButton *togglebutton, gpointer user_data) static gint on_var_type_ok_clicked (GtkWidget *w, gpointer data); +static gint hide_dialog (GtkWidget *w, gpointer data); -#define LEN 20 static void add_to_group (GtkWidget *w, gpointer data) @@ -334,6 +334,10 @@ var_type_dialog_create (GladeXML *xml) dialog->window = get_widget_assert (xml,"var_type_dialog"); + + g_signal_connect (dialog->window, "delete-event", + G_CALLBACK (gtk_widget_hide_on_delete), NULL); + gtk_window_set_transient_for (GTK_WINDOW (dialog->window), GTK_WINDOW (get_widget_assert (xml, "data_editor"))); @@ -542,11 +546,17 @@ var_type_dialog_create (GladeXML *xml) GTK_SIGNAL_FUNC (preview_custom), dialog); - /* Connect the OK button */ + /* Connect to the OK button */ g_signal_connect (dialog->ok, "clicked", G_CALLBACK (on_var_type_ok_clicked), dialog); + /* And the cancel button */ + g_signal_connect (get_widget_assert (xml, "var_type_cancel") , "clicked", + G_CALLBACK (hide_dialog), + dialog); + + } return dialog; @@ -832,10 +842,12 @@ on_var_type_ok_clicked (GtkWidget *w, gpointer data) -gint -on_var_type_cancel_clicked (GtkWidget *w, gpointer data) +static gint +hide_dialog (GtkWidget *w, gpointer data) { - gtk_widget_hide (w); + struct var_type_dialog *dialog = data; + + gtk_widget_hide (dialog->window); return FALSE; }