diff options
-rw-r--r-- | gtk/gtkbuilderscope.c | 13 | ||||
-rw-r--r-- | gtk/gtkbuilderscope.h | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gtk/gtkbuilderscope.c b/gtk/gtkbuilderscope.c index f5503c8b11..e9da61827a 100644 --- a/gtk/gtkbuilderscope.c +++ b/gtk/gtkbuilderscope.c @@ -429,6 +429,19 @@ gtk_builder_cscope_new (void) } /** + * gtk_builder_cscope_add_callback: + * @self: a `GtkBuilderCScope` + * @callback_symbols: (scope async): The callback pointer + * + * Adds the @callback_symbol to the scope of @builder under its + * own name. + * + * This is a convenience wrapper of [method@Gtk.BuilderCSope.add_callback_symbol]. + * + * Since: 4.8 + */ + +/** * gtk_builder_cscope_add_callback_symbol: * @self: a `GtkBuilderCScope` * @callback_name: The name of the callback, as expected in the XML diff --git a/gtk/gtkbuilderscope.h b/gtk/gtkbuilderscope.h index 7fc2ccbc0b..5ab602fc06 100644 --- a/gtk/gtkbuilderscope.h +++ b/gtk/gtkbuilderscope.h @@ -114,10 +114,14 @@ GDK_AVAILABLE_IN_ALL void gtk_builder_cscope_add_callback_symbols (GtkBuilderCScope *self, const char *first_callback_name, GCallback first_callback_symbol, - ...) G_GNUC_NULL_TERMINATED; + ...) G_GNUC_NULL_TERMINATED; + +#define gtk_builder_cscope_add_callback(scope, callback) \ + gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), #callback, G_CALLBACK (callback)) + GDK_AVAILABLE_IN_ALL GCallback gtk_builder_cscope_lookup_callback_symbol(GtkBuilderCScope *self, - const char *callback_name); + const char *callback_name); G_END_DECLS |