[gtk/stackpage] Add a GtkStackPage::widget property
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/stackpage] Add a GtkStackPage::widget property
- Date: Wed, 6 Feb 2019 23:55:46 +0000 (UTC)
commit b0cd8a3e8dacc1d6c3bb7aa6440e2b10ec51031a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 6 18:52:11 2019 -0500
Add a GtkStackPage::widget property
We are still trying to figure out the best way
to specify this in the ui file.
gtk/gtkstack.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 381d5b4268..4bad58d40a 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -142,6 +142,7 @@ enum {
enum
{
CHILD_PROP_0,
+ CHILD_PROP_WIDGET,
CHILD_PROP_NAME,
CHILD_PROP_TITLE,
CHILD_PROP_ICON_NAME,
@@ -210,6 +211,7 @@ gtk_stack_page_finalize (GObject *object)
{
GtkStackPage *page = GTK_STACK_PAGE (object);
+ g_object_unref (page->widget);
g_free (page->name);
g_free (page->title);
g_free (page->icon_name);
@@ -233,6 +235,10 @@ gtk_stack_page_get_property (GObject *object,
switch (property_id)
{
+ case CHILD_PROP_WIDGET:
+ g_value_set_object (value, info->widget);
+ break;
+
case CHILD_PROP_NAME:
g_value_set_string (value, info->name);
break;
@@ -284,6 +290,10 @@ gtk_stack_page_set_property (GObject *object,
switch (property_id)
{
+ case CHILD_PROP_WIDGET:
+ g_set_object (&info->widget, g_value_get_object (value));
+ break;
+
case CHILD_PROP_NAME:
name = g_value_dup_string (value);
for (l = priv ? priv->children : NULL; l != NULL; l = l->next)
@@ -345,6 +355,13 @@ gtk_stack_page_class_init (GtkStackPageClass *class)
object_class->get_property = gtk_stack_page_get_property;
object_class->set_property = gtk_stack_page_set_property;
+ stack_child_props[CHILD_PROP_WIDGET] =
+ g_param_spec_object ("widget",
+ P_("Widget"),
+ P_("The widget of the page"),
+ GTK_TYPE_WIDGET,
+ GTK_PARAM_READWRITE);
+
stack_child_props[CHILD_PROP_NAME] =
g_param_spec_string ("name",
P_("Name"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]