summaryrefslogtreecommitdiff
path: root/gtk/gtkcomboboxentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcomboboxentry.c')
-rw-r--r--gtk/gtkcomboboxentry.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gtk/gtkcomboboxentry.c b/gtk/gtkcomboboxentry.c
index f8b698a849..eff22d5c44 100644
--- a/gtk/gtkcomboboxentry.c
+++ b/gtk/gtkcomboboxentry.c
@@ -18,6 +18,7 @@
*/
#include <config.h>
+#include <string.h>
#include "gtkcomboboxentry.h"
#include "gtkcelllayout.h"
@@ -26,6 +27,7 @@
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtkbuildable.h"
#include "gtkalias.h"
#define GTK_COMBO_BOX_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_COMBO_BOX_ENTRY, GtkComboBoxEntryPrivate))
@@ -60,6 +62,10 @@ static void gtk_combo_box_entry_grab_focus (GtkWidget *widget);
static void has_frame_changed (GtkComboBoxEntry *entry_box,
GParamSpec *pspec,
gpointer data);
+static void gtk_combo_box_entry_buildable_interface_init (GtkBuildableIface *iface);
+static GObject * gtk_combo_box_entry_buildable_get_internal_child (GtkBuildable *buildable,
+ GtkBuilder *builder,
+ const gchar *childname);
enum
{
@@ -67,7 +73,9 @@ enum
PROP_TEXT_COLUMN
};
-G_DEFINE_TYPE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_CODE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ gtk_combo_box_entry_buildable_interface_init))
static void
gtk_combo_box_entry_class_init (GtkComboBoxEntryClass *klass)
@@ -130,6 +138,23 @@ gtk_combo_box_entry_init (GtkComboBoxEntry *entry_box)
}
static void
+gtk_combo_box_entry_buildable_interface_init (GtkBuildableIface *iface)
+{
+ iface->get_internal_child = gtk_combo_box_entry_buildable_get_internal_child;
+}
+
+static GObject *
+gtk_combo_box_entry_buildable_get_internal_child (GtkBuildable *buildable,
+ GtkBuilder *builder,
+ const gchar *childname)
+{
+ if (strcmp (childname, "entry") == 0)
+ return G_OBJECT (gtk_bin_get_child (GTK_BIN (buildable)));
+
+ return NULL;
+}
+
+static void
gtk_combo_box_entry_set_property (GObject *object,
guint prop_id,
const GValue *value,