diff options
author | Benjamin Otte <otte@redhat.com> | 2019-11-01 07:30:32 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-30 19:26:46 -0400 |
commit | db3e225f09fc79ed7af106c97642142c199131fd (patch) | |
tree | 1bcef3c5e221661c774e0a58d9b338e4adfdf6f7 /gtk/gtkbuilder.c | |
parent | a44c06b2646b0d44006dd882ffef843edbe7effc (diff) | |
download | gtk+-db3e225f09fc79ed7af106c97642142c199131fd.tar.gz |
builder: Make gtk_builder_extend_with_template() work with objects
This will be relevant later when we introduce GtkListItem which is not a
GtkWidget.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 4be00a4206..6121d2ed8e 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -1256,7 +1256,7 @@ gtk_builder_add_objects_from_file (GtkBuilder *builder, /** * gtk_builder_extend_with_template: * @builder: a #GtkBuilder - * @widget: the widget that is being extended + * @object: the object that is being extended * @template_type: the type that the template is for * @buffer: the string to parse * @length: the length of @buffer (may be -1 if @buffer is nul-terminated) @@ -1272,7 +1272,7 @@ gtk_builder_add_objects_from_file (GtkBuilder *builder, */ gboolean gtk_builder_extend_with_template (GtkBuilder *builder, - GtkWidget *widget, + GObject *object, GType template_type, const gchar *buffer, gssize length, @@ -1283,9 +1283,9 @@ gtk_builder_extend_with_template (GtkBuilder *builder, char *filename; g_return_val_if_fail (GTK_IS_BUILDER (builder), 0); - g_return_val_if_fail (GTK_IS_WIDGET (widget), 0); + g_return_val_if_fail (G_IS_OBJECT (object), 0); g_return_val_if_fail (g_type_name (template_type) != NULL, 0); - g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (widget), template_type), 0); + g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (object), template_type), 0); g_return_val_if_fail (buffer && buffer[0], 0); tmp_error = NULL; @@ -1297,7 +1297,7 @@ gtk_builder_extend_with_template (GtkBuilder *builder, priv->template_type = template_type; filename = g_strconcat ("<", g_type_name (template_type), " template>", NULL); - gtk_builder_expose_object (builder, g_type_name (template_type), G_OBJECT (widget)); + gtk_builder_expose_object (builder, g_type_name (template_type), object); _gtk_builder_parser_parse_buffer (builder, filename, buffer, length, NULL, |