Basics
Guides
API Reference
Basics
Guides
API Reference
[22:7] extends: object
A GtkBuilderScope implementation for the C language. GtkBuilderCScope
instances use symbols explicitly added to @builder with prior calls to
[method@Gtk.BuilderCScope.add_callback_symbol]. If developers want to do
that, they are encouraged to create their own scopes for that purpose. In the
case that symbols are not explicitly added; GTK will uses GModule’s
introspective features (by opening the module %NULL) to look at the
application’s symbol table. From here it tries to match the signal function
names given in the interface description with symbols in the application.
Note that unless [method@Gtk.BuilderCScope.add_callback_symbol] is called for
all signal callbacks which are referenced by the loaded XML, this
functionality will require that GModule be supported on the platform.
GtkBuilderCScope (Handle = null)
Creates a new
GtkBuilderCScopeobject to use with futureGtkBuilderinstances. Calling this function is only necessary if you want to add custom callbacks via [method@Gtk.BuilderCScope.add_callback_symbol].
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
GObject.
A GObject object.asBuilderScope ()
Wraps this handle as
GtkBuilderScope.
A GtkBuilderScope object.add_callback_symbol (string callback_name, object callback_symbol)
Adds the @callback_symbol to the scope of @builder under the given
Using this function overrides the behavior of [method@Gtk.Builder.create_closure] for any callback symbols that are added. Using this method allows for better encapsulation as it does not require that callback symbols be declared in the global namespace.callback_name is The name of the callback, as expected in the XML.callback_symbol is The callback pointer.None.add_callback_symbols (string first_callback_name, object first_callback_symbol, list varargs)
A convenience function to add many callbacks. This is equivalent to calling [method@Gtk.BuilderCScope.add_callback_symbol] for each symbol.
first_callback_name is The name of the callback, as expected in the XML.first_callback_symbol is The callback pointer.... is A list of callback name and callback symbol pairs terminated with %NULL.None.lookup_callback_symbol (string callback_name)
Fetches a symbol previously added with gtk_builder_cscope_add_callback_symbol().
callback_name is The name of the callback.The callback symbol in @builder for @callback_name.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.