QUICK CLUSTER: Fix infinite loop on bad command name.
[pspp.git] / glade / dialog.c
blob7b13226e01d25203fb748119f61360d25014c7ae
1 #include <config.h>
2 #include <glib.h>
3 #include <gtk/gtk.h>
5 #include "psppire-dialog.h"
6 #include <string.h>
7 #include <assert.h>
8 #include <gladeui/glade.h>
11 void
12 glade_psppire_dialog_post_create (GladeWidgetAdaptor *adaptor,
13 GObject *object,
14 GladeCreateReason reason)
16 GladeWidget *widget ;
18 GladeWidget *box_widget;
20 PsppireDialog *dialog = PSPPIRE_DIALOG (object);
22 g_return_if_fail (PSPPIRE_IS_DIALOG (dialog));
24 widget = glade_widget_get_from_gobject (GTK_WIDGET (dialog));
25 if (!widget)
26 return;
29 if (reason == GLADE_CREATE_USER)
31 /* HIG compliant border-width defaults on dialogs */
32 glade_widget_property_set (widget, "border-width", 5);
35 box_widget = glade_widget_adaptor_create_internal
36 (widget, G_OBJECT(dialog->box),
37 "hbox", "dialog", FALSE, reason);
39 /* These properties are controlled by the GtkDialog style properties:
40 * "content-area-border", "button-spacing" and "action-area-border",
41 * so we must disable their use.
43 glade_widget_remove_property (box_widget, "border-width");
45 /* Only set these on the original create. */
46 if (reason == GLADE_CREATE_USER)
49 /* HIG compliant spacing defaults on dialogs */
50 glade_widget_property_set (box_widget, "spacing", 2);
52 glade_widget_property_set (box_widget, "size", 2);
58 GtkWidget *
59 glade_psppire_dialog_get_internal_child (GladeWidgetAdaptor *adaptor,
60 PsppireDialog *dialog,
61 const gchar *name)
63 #if DEBUGGING
64 g_print ("%s\n", __FUNCTION__);
65 #endif
67 g_assert (0 == strcmp (name, "hbox"));
69 return dialog->box;
74 void
75 glade_psppire_dialog_set_property (GladeWidgetAdaptor *adaptor,
76 GObject *object,
77 const gchar *id,
78 const GValue *value)
80 #if DEBUGGING
81 g_print ("%s(%p) Type=\"%s\" Id=\"%s\"\n", __FUNCTION__, object,
82 G_OBJECT_TYPE_NAME( object ),
83 id);
84 #endif
86 assert ( GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property );
88 GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object,
89 id, value);
94 GList *
95 glade_psppire_dialog_get_children (GladeWidgetAdaptor *adaptor,
96 PsppireDialog *dialog)
98 GList *list = NULL;
100 g_return_val_if_fail (PSPPIRE_IS_DIALOG (dialog), NULL);
102 list = glade_util_container_get_all_children (GTK_CONTAINER (dialog));
104 return list;