1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28 #include "gtkbutton.h"
29 #include "gtkdialog.h"
31 #include "gtkhseparator.h"
32 #include "gtkmarshalers.h"
34 #include "gdkkeysyms.h"
37 #include "gtkbindings.h"
39 #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate))
42 guint ignore_separator : 1;
45 typedef struct _ResponseData ResponseData;
52 static void gtk_dialog_class_init (GtkDialogClass *klass);
53 static void gtk_dialog_init (GtkDialog *dialog);
55 static void gtk_dialog_add_buttons_valist (GtkDialog *dialog,
56 const gchar *first_button_text,
59 static gint gtk_dialog_delete_event_handler (GtkWidget *widget,
63 static void gtk_dialog_set_property (GObject *object,
67 static void gtk_dialog_get_property (GObject *object,
71 static void gtk_dialog_style_set (GtkWidget *widget,
72 GtkStyle *prev_style);
73 static void gtk_dialog_map (GtkWidget *widget);
75 static void gtk_dialog_close (GtkDialog *dialog);
77 static ResponseData* get_response_data (GtkWidget *widget);
90 static gpointer parent_class;
91 static guint dialog_signals[LAST_SIGNAL];
94 gtk_dialog_get_type (void)
96 static GType dialog_type = 0;
100 static const GTypeInfo dialog_info =
102 sizeof (GtkDialogClass),
103 NULL, /* base_init */
104 NULL, /* base_finalize */
105 (GClassInitFunc) gtk_dialog_class_init,
106 NULL, /* class_finalize */
107 NULL, /* class_data */
110 (GInstanceInitFunc) gtk_dialog_init,
113 dialog_type = g_type_register_static (GTK_TYPE_WINDOW, "GtkDialog",
121 gtk_dialog_class_init (GtkDialogClass *class)
123 GObjectClass *gobject_class;
124 GtkWidgetClass *widget_class;
125 GtkBindingSet *binding_set;
127 gobject_class = G_OBJECT_CLASS (class);
128 widget_class = GTK_WIDGET_CLASS (class);
130 parent_class = g_type_class_peek_parent (class);
132 gobject_class->set_property = gtk_dialog_set_property;
133 gobject_class->get_property = gtk_dialog_get_property;
135 widget_class->map = gtk_dialog_map;
136 widget_class->style_set = gtk_dialog_style_set;
138 class->close = gtk_dialog_close;
140 g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate));
142 g_object_class_install_property (gobject_class,
144 g_param_spec_boolean ("has_separator",
146 P_("The dialog has a separator bar above its buttons"),
150 dialog_signals[RESPONSE] =
151 g_signal_new ("response",
152 G_OBJECT_CLASS_TYPE (class),
154 G_STRUCT_OFFSET (GtkDialogClass, response),
156 _gtk_marshal_NONE__INT,
160 dialog_signals[CLOSE] =
161 g_signal_new ("close",
162 G_OBJECT_CLASS_TYPE (class),
163 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
164 G_STRUCT_OFFSET (GtkDialogClass, close),
166 _gtk_marshal_NONE__NONE,
169 gtk_widget_class_install_style_property (widget_class,
170 g_param_spec_int ("content_area_border",
171 P_("Content area border"),
172 P_("Width of border around the main dialog area"),
177 gtk_widget_class_install_style_property (widget_class,
178 g_param_spec_int ("button_spacing",
179 P_("Button spacing"),
180 P_("Spacing between buttons"),
186 gtk_widget_class_install_style_property (widget_class,
187 g_param_spec_int ("action_area_border",
188 P_("Action area border"),
189 P_("Width of border around the button area at the bottom of the dialog"),
195 binding_set = gtk_binding_set_by_class (class);
197 gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
202 update_spacings (GtkDialog *dialog)
205 gint content_area_border;
207 gint action_area_border;
209 widget = GTK_WIDGET (dialog);
211 gtk_widget_style_get (widget,
212 "content_area_border",
213 &content_area_border,
216 "action_area_border",
220 gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox),
221 content_area_border);
222 gtk_box_set_spacing (GTK_BOX (dialog->action_area),
224 gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area),
229 gtk_dialog_init (GtkDialog *dialog)
231 GtkDialogPrivate *priv;
233 priv = GET_PRIVATE (dialog);
234 priv->ignore_separator = FALSE;
236 /* To avoid breaking old code that prevents destroy on delete event
237 * by connecting a handler, we have to have the FIRST signal
238 * connection on the dialog.
240 g_signal_connect (dialog,
242 G_CALLBACK (gtk_dialog_delete_event_handler),
245 dialog->vbox = gtk_vbox_new (FALSE, 0);
247 gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
248 gtk_widget_show (dialog->vbox);
250 dialog->action_area = gtk_hbutton_box_new ();
252 gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area),
255 gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
257 gtk_widget_show (dialog->action_area);
259 dialog->separator = gtk_hseparator_new ();
260 gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
261 gtk_widget_show (dialog->separator);
263 gtk_window_set_type_hint (GTK_WINDOW (dialog),
264 GDK_WINDOW_TYPE_HINT_DIALOG);
265 gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
270 gtk_dialog_set_property (GObject *object,
277 dialog = GTK_DIALOG (object);
281 case PROP_HAS_SEPARATOR:
282 gtk_dialog_set_has_separator (dialog, g_value_get_boolean (value));
286 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
292 gtk_dialog_get_property (GObject *object,
299 dialog = GTK_DIALOG (object);
303 case PROP_HAS_SEPARATOR:
304 g_value_set_boolean (value, dialog->separator != NULL);
308 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
314 gtk_dialog_delete_event_handler (GtkWidget *widget,
318 /* emit response signal */
319 gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_DELETE_EVENT);
321 /* Do the destroy by default */
325 /* A far too tricky heuristic for getting the right initial
326 * focus widget if none was set. What we do is we focus the first
327 * widget in the tab chain, but if this results in the focus
328 * ending up on one of the response widgets _other_ than the
329 * default response, we focus the default response instead.
332 gtk_dialog_map (GtkWidget *widget)
334 GtkWindow *window = GTK_WINDOW (widget);
335 GtkDialog *dialog = GTK_DIALOG (widget);
337 GTK_WIDGET_CLASS (parent_class)->map (widget);
339 if (!window->focus_widget)
341 GList *children, *tmp_list;
343 g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
345 tmp_list = children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
349 GtkWidget *child = tmp_list->data;
351 if (child == window->focus_widget && child != window->default_widget && window->default_widget)
353 gtk_widget_grab_focus (window->default_widget);
357 tmp_list = tmp_list->next;
360 g_list_free (children);
365 gtk_dialog_style_set (GtkWidget *widget,
366 GtkStyle *prev_style)
368 update_spacings (GTK_DIALOG (widget));
372 dialog_has_cancel (GtkDialog *dialog)
374 GList *children, *tmp_list;
375 gboolean ret = FALSE;
377 children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
379 for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
381 ResponseData *rd = get_response_data (tmp_list->data);
383 if (rd && rd->response_id == GTK_RESPONSE_CANCEL)
390 g_list_free (children);
396 gtk_dialog_close (GtkDialog *dialog)
398 /* Synthesize delete_event to close dialog. */
400 GtkWidget *widget = GTK_WIDGET (dialog);
403 if (!dialog_has_cancel (dialog))
406 event = gdk_event_new (GDK_DELETE);
408 event->any.window = g_object_ref (widget->window);
409 event->any.send_event = TRUE;
411 gtk_main_do_event (event);
412 gdk_event_free (event);
416 gtk_dialog_new (void)
418 return g_object_new (GTK_TYPE_DIALOG, NULL);
422 gtk_dialog_new_empty (const gchar *title,
424 GtkDialogFlags flags)
428 dialog = g_object_new (GTK_TYPE_DIALOG, NULL);
431 gtk_window_set_title (GTK_WINDOW (dialog), title);
434 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
436 if (flags & GTK_DIALOG_MODAL)
437 gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
439 if (flags & GTK_DIALOG_DESTROY_WITH_PARENT)
440 gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
442 if (flags & GTK_DIALOG_NO_SEPARATOR)
443 gtk_dialog_set_has_separator (dialog, FALSE);
445 return GTK_WIDGET (dialog);
449 * gtk_dialog_new_with_buttons:
450 * @title: Title of the dialog, or %NULL
451 * @parent: Transient parent of the dialog, or %NULL
452 * @flags: from #GtkDialogFlags
453 * @first_button_text: stock ID or text to go in first button, or %NULL
454 * @Varargs: response ID for first button, then additional buttons, ending with %NULL
456 * Creates a new #GtkDialog with title @title (or %NULL for the default
457 * title; see gtk_window_set_title()) and transient parent @parent (or
458 * %NULL for none; see gtk_window_set_transient_for()). The @flags
459 * argument can be used to make the dialog modal (#GTK_DIALOG_MODAL)
460 * and/or to have it destroyed along with its transient parent
461 * (#GTK_DIALOG_DESTROY_WITH_PARENT). After @flags, button
462 * text/response ID pairs should be listed, with a %NULL pointer ending
463 * the list. Button text can be either a stock ID such as
464 * #GTK_STOCK_OK, or some arbitrary text. A response ID can be
465 * any positive number, or one of the values in the #GtkResponseType
466 * enumeration. If the user clicks one of these dialog buttons,
467 * #GtkDialog will emit the "response" signal with the corresponding
468 * response ID. If a #GtkDialog receives the "delete_event" signal, it
469 * will emit "response" with a response ID of #GTK_RESPONSE_DELETE_EVENT.
470 * However, destroying a dialog does not emit the "response" signal;
471 * so be careful relying on "response" when using
472 * the #GTK_DIALOG_DESTROY_WITH_PARENT flag. Buttons are from left to right,
473 * so the first button in the list will be the leftmost button in the dialog.
475 * Here's a simple example:
476 * <informalexample><programlisting>
477 * GtkWidget *dialog = gtk_dialog_new_with_buttons ("My dialog",
479 * GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
481 * GTK_RESPONSE_ACCEPT,
483 * GTK_RESPONSE_REJECT,
485 * </programlisting></informalexample>
487 * Return value: a new #GtkDialog
490 gtk_dialog_new_with_buttons (const gchar *title,
492 GtkDialogFlags flags,
493 const gchar *first_button_text,
499 dialog = GTK_DIALOG (gtk_dialog_new_empty (title, parent, flags));
501 va_start (args, first_button_text);
503 gtk_dialog_add_buttons_valist (dialog,
509 return GTK_WIDGET (dialog);
513 get_response_data (GtkWidget *widget)
515 ResponseData *ad = g_object_get_data (G_OBJECT (widget),
516 "gtk-dialog-response-data");
520 ad = g_new (ResponseData, 1);
522 g_object_set_data_full (G_OBJECT (widget),
523 "gtk-dialog-response-data",
532 action_widget_activated (GtkWidget *widget, GtkDialog *dialog)
537 g_return_if_fail (GTK_IS_DIALOG (dialog));
539 response_id = GTK_RESPONSE_NONE;
541 ad = get_response_data (widget);
543 g_assert (ad != NULL);
545 response_id = ad->response_id;
547 gtk_dialog_response (dialog, response_id);
551 * gtk_dialog_add_action_widget:
552 * @dialog: a #GtkDialog
553 * @child: an activatable widget
554 * @response_id: response ID for @child
556 * Adds an activatable widget to the action area of a #GtkDialog,
557 * connecting a signal handler that will emit the "response" signal on
558 * the dialog when the widget is activated. The widget is appended to
559 * the end of the dialog's action area. If you want to add a
560 * non-activatable widget, simply pack it into the
561 * <literal>action_area</literal> field of the #GtkDialog struct.
564 gtk_dialog_add_action_widget (GtkDialog *dialog,
571 g_return_if_fail (GTK_IS_DIALOG (dialog));
572 g_return_if_fail (GTK_IS_WIDGET (child));
574 ad = get_response_data (child);
576 ad->response_id = response_id;
578 if (GTK_IS_BUTTON (child))
579 signal_id = g_signal_lookup ("clicked", GTK_TYPE_BUTTON);
581 signal_id = GTK_WIDGET_GET_CLASS (child)->activate_signal != 0;
587 closure = g_cclosure_new_object (G_CALLBACK (action_widget_activated),
589 g_signal_connect_closure_by_id (child,
596 g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkDialog");
598 gtk_box_pack_end (GTK_BOX (dialog->action_area),
602 if (response_id == GTK_RESPONSE_HELP)
603 gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area), child, TRUE);
607 * gtk_dialog_add_button:
608 * @dialog: a #GtkDialog
609 * @button_text: text of button, or stock ID
610 * @response_id: response ID for the button
612 * Adds a button with the given text (or a stock button, if @button_text is a
613 * stock ID) and sets things up so that clicking the button will emit the
614 * "response" signal with the given @response_id. The button is appended to the
615 * end of the dialog's action area. The button widget is returned, but usually
618 * Return value: the button widget that was added
621 gtk_dialog_add_button (GtkDialog *dialog,
622 const gchar *button_text,
627 g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
628 g_return_val_if_fail (button_text != NULL, NULL);
630 button = gtk_button_new_from_stock (button_text);
632 GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
634 gtk_widget_show (button);
636 gtk_dialog_add_action_widget (dialog,
644 gtk_dialog_add_buttons_valist (GtkDialog *dialog,
645 const gchar *first_button_text,
651 g_return_if_fail (GTK_IS_DIALOG (dialog));
653 if (first_button_text == NULL)
656 text = first_button_text;
657 response_id = va_arg (args, gint);
661 gtk_dialog_add_button (dialog, text, response_id);
663 text = va_arg (args, gchar*);
666 response_id = va_arg (args, int);
671 * gtk_dialog_add_buttons:
672 * @dialog: a #GtkDialog
673 * @first_button_text: button text or stock ID
674 * @Varargs: response ID for first button, then more text-response_id pairs
676 * Adds more buttons, same as calling gtk_dialog_add_button()
677 * repeatedly. The variable argument list should be %NULL-terminated
678 * as with gtk_dialog_new_with_buttons(). Each button must have both
679 * text and response ID.
682 gtk_dialog_add_buttons (GtkDialog *dialog,
683 const gchar *first_button_text,
688 va_start (args, first_button_text);
690 gtk_dialog_add_buttons_valist (dialog,
698 * gtk_dialog_set_response_sensitive:
699 * @dialog: a #GtkDialog
700 * @response_id: a response ID
701 * @setting: %TRUE for sensitive
703 * Calls <literal>gtk_widget_set_sensitive (widget, @setting)</literal>
704 * for each widget in the dialog's action area with the given @response_id.
705 * A convenient way to sensitize/desensitize dialog buttons.
708 gtk_dialog_set_response_sensitive (GtkDialog *dialog,
715 g_return_if_fail (GTK_IS_DIALOG (dialog));
717 children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
720 while (tmp_list != NULL)
722 GtkWidget *widget = tmp_list->data;
723 ResponseData *rd = g_object_get_data (G_OBJECT (widget),
724 "gtk-dialog-response-data");
726 if (rd && rd->response_id == response_id)
727 gtk_widget_set_sensitive (widget, setting);
729 tmp_list = g_list_next (tmp_list);
732 g_list_free (children);
736 * gtk_dialog_set_default_response:
737 * @dialog: a #GtkDialog
738 * @response_id: a response ID
740 * Sets the last widget in the dialog's action area with the given @response_id
741 * as the default widget for the dialog. Pressing "Enter" normally activates
742 * the default widget.
745 gtk_dialog_set_default_response (GtkDialog *dialog,
751 g_return_if_fail (GTK_IS_DIALOG (dialog));
753 children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
756 while (tmp_list != NULL)
758 GtkWidget *widget = tmp_list->data;
759 ResponseData *rd = g_object_get_data (G_OBJECT (widget),
760 "gtk-dialog-response-data");
762 if (rd && rd->response_id == response_id)
763 gtk_widget_grab_default (widget);
765 tmp_list = g_list_next (tmp_list);
768 g_list_free (children);
772 * gtk_dialog_set_has_separator:
773 * @dialog: a #GtkDialog
774 * @setting: %TRUE to have a separator
776 * Sets whether the dialog has a separator above the buttons.
780 gtk_dialog_set_has_separator (GtkDialog *dialog,
783 GtkDialogPrivate *priv;
785 g_return_if_fail (GTK_IS_DIALOG (dialog));
787 priv = GET_PRIVATE (dialog);
789 /* this might fail if we get called before _init() somehow */
790 g_assert (dialog->vbox != NULL);
792 if (priv->ignore_separator)
794 g_warning ("Ignoring the separator setting");
798 if (setting && dialog->separator == NULL)
800 dialog->separator = gtk_hseparator_new ();
801 gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
803 /* The app programmer could screw this up, but, their own fault.
804 * Moves the separator just above the action area.
806 gtk_box_reorder_child (GTK_BOX (dialog->vbox), dialog->separator, 1);
807 gtk_widget_show (dialog->separator);
809 else if (!setting && dialog->separator != NULL)
811 gtk_widget_destroy (dialog->separator);
812 dialog->separator = NULL;
815 g_object_notify (G_OBJECT (dialog), "has_separator");
819 * gtk_dialog_get_has_separator:
820 * @dialog: a #GtkDialog
822 * Accessor for whether the dialog has a separator.
824 * Return value: %TRUE if the dialog has a separator
827 gtk_dialog_get_has_separator (GtkDialog *dialog)
829 g_return_val_if_fail (GTK_IS_DIALOG (dialog), FALSE);
831 return dialog->separator != NULL;
835 * gtk_dialog_response:
836 * @dialog: a #GtkDialog
837 * @response_id: response ID
839 * Emits the "response" signal with the given response ID. Used to
840 * indicate that the user has responded to the dialog in some way;
841 * typically either you or gtk_dialog_run() will be monitoring the
842 * "response" signal and take appropriate action.
845 gtk_dialog_response (GtkDialog *dialog,
848 g_return_if_fail (GTK_IS_DIALOG (dialog));
850 g_signal_emit (dialog,
851 dialog_signals[RESPONSE],
865 shutdown_loop (RunInfo *ri)
867 if (g_main_loop_is_running (ri->loop))
868 g_main_loop_quit (ri->loop);
872 run_unmap_handler (GtkDialog *dialog, gpointer data)
880 run_response_handler (GtkDialog *dialog,
888 ri->response_id = response_id;
894 run_delete_handler (GtkDialog *dialog,
902 return TRUE; /* Do not destroy */
906 run_destroy_handler (GtkDialog *dialog, gpointer data)
910 /* shutdown_loop will be called by run_unmap_handler */
912 ri->destroyed = TRUE;
917 * @dialog: a #GtkDialog
919 * Blocks in a recursive main loop until the @dialog either emits the
920 * response signal, or is destroyed. If the dialog is destroyed during the call
921 * to gtk_dialog_run(), gtk_dialog_returns #GTK_RESPONSE_NONE.
922 * Otherwise, it returns the response ID from the "response" signal emission.
923 * Before entering the recursive main loop, gtk_dialog_run() calls
924 * gtk_widget_show() on the dialog for you. Note that you still
925 * need to show any children of the dialog yourself.
927 * During gtk_dialog_run(), the default behavior of "delete_event" is
928 * disabled; if the dialog receives "delete_event", it will not be
929 * destroyed as windows usually are, and gtk_dialog_run() will return
930 * #GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog will be
931 * modal. You can force gtk_dialog_run() to return at any time by
932 * calling gtk_dialog_response() to emit the "response"
933 * signal. Destroying the dialog during gtk_dialog_run() is a very bad
934 * idea, because your post-run code won't know whether the dialog was
937 * After gtk_dialog_run() returns, you are responsible for hiding or
938 * destroying the dialog if you wish to do so.
940 * Typical usage of this function might be:
941 * <informalexample><programlisting>
942 * gint result = gtk_dialog_run (GTK_DIALOG (dialog));
945 * case GTK_RESPONSE_ACCEPT:
946 * do_application_specific_something (<!-- -->);
949 * do_nothing_since_dialog_was_cancelled (<!-- -->);
952 * gtk_widget_destroy (dialog);
953 * </programlisting></informalexample>
955 * Return value: response ID
958 gtk_dialog_run (GtkDialog *dialog)
960 RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL };
962 gulong response_handler;
963 gulong unmap_handler;
964 gulong destroy_handler;
965 gulong delete_handler;
967 g_return_val_if_fail (GTK_IS_DIALOG (dialog), -1);
969 g_object_ref (dialog);
971 was_modal = GTK_WINDOW (dialog)->modal;
973 gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
975 if (!GTK_WIDGET_VISIBLE (dialog))
976 gtk_widget_show (GTK_WIDGET (dialog));
979 g_signal_connect (dialog,
981 G_CALLBACK (run_response_handler),
985 g_signal_connect (dialog,
987 G_CALLBACK (run_unmap_handler),
991 g_signal_connect (dialog,
993 G_CALLBACK (run_delete_handler),
997 g_signal_connect (dialog,
999 G_CALLBACK (run_destroy_handler),
1002 ri.loop = g_main_loop_new (NULL, FALSE);
1004 GDK_THREADS_LEAVE ();
1005 g_main_loop_run (ri.loop);
1006 GDK_THREADS_ENTER ();
1008 g_main_loop_unref (ri.loop);
1011 ri.destroyed = FALSE;
1016 gtk_window_set_modal (GTK_WINDOW(dialog), FALSE);
1018 g_signal_handler_disconnect (dialog, response_handler);
1019 g_signal_handler_disconnect (dialog, unmap_handler);
1020 g_signal_handler_disconnect (dialog, delete_handler);
1021 g_signal_handler_disconnect (dialog, destroy_handler);
1024 g_object_unref (dialog);
1026 return ri.response_id;
1030 _gtk_dialog_set_ignore_separator (GtkDialog *dialog,
1031 gboolean ignore_separator)
1033 GtkDialogPrivate *priv;
1035 priv = GET_PRIVATE (dialog);
1036 priv->ignore_separator = ignore_separator;