File: dialog.c

package info (click to toggle)
pspp 0.6.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 18,664 kB
  • ctags: 13,313
  • sloc: ansic: 132,458; sh: 48,033; perl: 1,252; lisp: 597; xml: 154; makefile: 132; sed: 16
file content (105 lines) | stat: -rw-r--r-- 2,374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <glib.h>
#include <gtk/gtk.h>

#include "psppire-dialog.h"
#include <string.h>
#include <assert.h>
#include <string.h>
#include <gladeui/glade.h>


void
glade_psppire_dialog_post_create (GladeWidgetAdaptor *adaptor,
				  GObject            *object,
				  GladeCreateReason   reason)
{
  GladeWidget *widget ;

  GladeWidget  *box_widget;

  PsppireDialog    *dialog = PSPPIRE_DIALOG (object);

  g_return_if_fail (PSPPIRE_IS_DIALOG (dialog));

  widget = glade_widget_get_from_gobject (GTK_WIDGET (dialog));
  if (!widget)
    return;


  if (reason == GLADE_CREATE_USER)
    {
      /* HIG compliant border-width defaults on dialogs */
      glade_widget_property_set (widget, "border-width", 5);
    }

  box_widget = glade_widget_adaptor_create_internal
    (widget, G_OBJECT(dialog->box),
     "hbox", "dialog", FALSE, reason);

  /* These properties are controlled by the GtkDialog style properties:
   * "content-area-border", "button-spacing" and "action-area-border",
   * so we must disable their use.
   */
  glade_widget_remove_property (box_widget, "border-width");

  /* Only set these on the original create. */
  if (reason == GLADE_CREATE_USER)
    {

      /* HIG compliant spacing defaults on dialogs */
      glade_widget_property_set (box_widget, "spacing", 2);

      glade_widget_property_set (box_widget, "size", 2);

    }
}


GtkWidget *
glade_psppire_dialog_get_internal_child (GladeWidgetAdaptor  *adaptor,
					 PsppireDialog       *dialog,
					 const gchar         *name)
{
#if DEBUGGING
  g_print ("%s\n", __FUNCTION__);
#endif

  g_assert (0 == strcmp (name, "hbox"));

  return dialog->box;
}



void
glade_psppire_dialog_set_property (GladeWidgetAdaptor *adaptor,
				   GObject            *object,
				   const gchar        *id,
				   const GValue       *value)
{
#if DEBUGGING
  g_print ("%s(%p) Type=\"%s\" Id=\"%s\"\n", __FUNCTION__, object,
	   G_OBJECT_TYPE_NAME( object ),
	   id);
#endif

  assert (  GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property );

  GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object,
						 id, value);
}



GList *
glade_psppire_dialog_get_children (GladeWidgetAdaptor  *adaptor,
				   PsppireDialog  *dialog)
{
  GList *list = NULL;

  g_return_val_if_fail (PSPPIRE_IS_DIALOG (dialog), NULL);

  list = glade_util_container_get_all_children (GTK_CONTAINER (dialog));

  return list;
}