From e6e91e018e8d6c278aff859be10f5ddfcc06dd6d Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 3 Apr 2009 09:46:13 +0800 Subject: [PATCH] Add PsppireDictView to glade library. Make the PsppireDictView widget available to users of glade. --- glade/automake.mk | 2 + glade/dictview.c | 82 +++++++++++++++++++++++++++++++++++ glade/psppire.xml | 21 ++++++++- src/ui/gui/psppire-dictview.c | 5 ++- 4 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 glade/dictview.c diff --git a/glade/automake.mk b/glade/automake.mk index 59a88668..8e51e1f7 100644 --- a/glade/automake.mk +++ b/glade/automake.mk @@ -14,6 +14,7 @@ libglade_psppire_la_SOURCES = \ glade/bbox.c \ glade/selector.c \ glade/acr.c \ + glade/dictview.c \ src/ui/gui/psppire-conf.c \ src/ui/gui/psppire-acr.c \ src/ui/gui/psppire-buttonbox.c \ @@ -21,6 +22,7 @@ libglade_psppire_la_SOURCES = \ src/ui/gui/psppire-vbuttonbox.c \ src/ui/gui/psppire-dialog.c \ src/ui/gui/psppire-keypad.c \ + src/ui/gui/psppire-dictview.c \ src/ui/gui/psppire-selector.c dist_catalog_DATA = \ diff --git a/glade/dictview.c b/glade/dictview.c new file mode 100644 index 00000000..5d23b06d --- /dev/null +++ b/glade/dictview.c @@ -0,0 +1,82 @@ +#include + +#include +#include +#include "psppire-dictview.h" + +#include + + +GType +psppire_dict_get_type () +{ + return 0; +} + + + +void +glade_psppire_dictview_post_create (GladeWidgetAdaptor *adaptor, + GObject *object, + GladeCreateReason reason) +{ + GladeWidget *widget ; + + PsppireDictView *dictview = PSPPIRE_DICT_VIEW (object); + + g_return_if_fail (PSPPIRE_IS_DICT_VIEW (dictview)); + + widget = glade_widget_get_from_gobject (GTK_WIDGET (dictview)); + if (!widget) + return; + + if (reason == GLADE_CREATE_USER) + { + /* HIG complient border-width defaults on dictviews */ + glade_widget_property_set (widget, "border-width", 5); + } +} + + +GtkWidget * +glade_psppire_dictview_get_internal_child (GladeWidgetAdaptor *adaptor, + PsppireDictView *dictview, + const gchar *name) +{ +#if DEBUGGING + g_print ("%s\n", __FUNCTION__); +#endif + return GTK_WIDGET (dictview); +} + + + +void +glade_psppire_dictview_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 + + GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object, + id, value); +} + + +GList * +glade_psppire_dictview_get_children (GladeWidgetAdaptor *adaptor, + PsppireDictView *dv) +{ + GList *list = NULL; + + g_return_val_if_fail (PSPPIRE_IS_DICT_VIEW (dv), NULL); + + list = glade_util_container_get_all_children (GTK_CONTAINER (dv)); + + return list; +} diff --git a/glade/psppire.xml b/glade/psppire.xml index e2dc4b76..50a03661 100644 --- a/glade/psppire.xml +++ b/glade/psppire.xml @@ -197,6 +197,24 @@ + + + + + glade_psppire_dictview_post_create + glade_psppire_dictview_get_children + glade_psppire_dictview_get_internal_child + + + + + + + + + + + @@ -204,8 +222,9 @@ - + + diff --git a/src/ui/gui/psppire-dictview.c b/src/ui/gui/psppire-dictview.c index 863365f9..a2cc7df8 100644 --- a/src/ui/gui/psppire-dictview.c +++ b/src/ui/gui/psppire-dictview.c @@ -509,7 +509,10 @@ psppire_dict_view_init (PsppireDictView *dict_view) gtk_tree_view_append_column (GTK_TREE_VIEW (dict_view), col); - g_object_set (dict_view, "has-tooltip", TRUE, NULL); + g_object_set (dict_view, + "has-tooltip", TRUE, + "headers-visible", FALSE, + NULL); g_signal_connect (dict_view, "query-tooltip", G_CALLBACK (set_tooltip_for_variable), NULL); -- 2.30.2