A GtkBuilderScope implementation for the C language.
GtkBuilderCScope instances use symbols explicitly added to Builder with prior calls to [methodGtk.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 [methodGtk.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.
function "+"
(Widget : access Gtk_Builder_C_Scope_Record'Class)
return Gtk.Builder_Scope.Gtk_Builder_Scope
function "-"
(Interf : Gtk.Builder_Scope.Gtk_Builder_Scope)
return Gtk_Builder_C_Scope
procedure Add_Callback_Symbol
(Self : not null access Gtk_Builder_C_Scope_Record;
Callback_Name : UTF8_String;
Callback_Symbol : G_Callback)
Adds the Callback_Symbol to the scope of Builder under the given Callback_Name. Using this function overrides the behavior of [methodGtk.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.
The name of the callback, as expected in the XML
The callback pointer
type G_Callback is access procedure;
The type used for callback functions in structure definitions and function signatures. This doesn't mean that all callback functions must take no parameters and return void. The required signature of a callback function is determined by the context in which is used (e.g. the signal to which it is connected).
function Get_Type return Glib.GType
type Gtk_Builder_C_Scope is access all Gtk_Builder_C_Scope_Record'Class;
function Gtk_Builder_C_Scope_New return Gtk_Builder_C_Scope
Creates a new GtkBuilderCScope object to use with future GtkBuilder instances. Calling this function is only necessary if you want to add custom callbacks via [methodGtk.BuilderCScope.add_callback_symbol].
type Gtk_Builder_C_Scope_Record is new GObject_Record with null record;
procedure Gtk_New (Self : out Gtk_Builder_C_Scope)
Creates a new GtkBuilderCScope object to use with future GtkBuilder instances. Calling this function is only necessary if you want to add custom callbacks via [methodGtk.BuilderCScope.add_callback_symbol]. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
package Implements_Gtk_Builder_Scope is new Glib.Types.Implements
(Gtk.Builder_Scope.Gtk_Builder_Scope, Gtk_Builder_C_Scope_Record, Gtk_Builder_C_Scope);
procedure Initialize
(Self : not null access Gtk_Builder_C_Scope_Record'Class)
Creates a new GtkBuilderCScope object to use with future GtkBuilder instances. Calling this function is only necessary if you want to add custom callbacks via [methodGtk.BuilderCScope.add_callback_symbol]. Initialize does nothing if the object was already created with another call to Initialize* or G_New.