Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GtkBuilderCScope

[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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GtkBuilderCScope (Handle = null)

    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 [method@Gtk.BuilderCScope.add_callback_symbol].

    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as GObject.

    • @r A GObject object.
  • asBuilderScope ()

    Wraps this handle as GtkBuilderScope.

    • @r A GtkBuilderScope object.
  • add_callback_symbol (string callback_name, object callback_symbol)

    Adds the @callback_symbol to the scope of @builder under the given

    • @callback_name. 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.
    • @p callback_name is The name of the callback, as expected in the XML.
    • @p callback_symbol is The callback pointer.
    • @r 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.

    • @p first_callback_name is The name of the callback, as expected in the XML.
    • @p first_callback_symbol is The callback pointer.
    • @p ... is A list of callback name and callback symbol pairs terminated with %NULL.
    • @r None.
  • lookup_callback_symbol (string callback_name)

    Fetches a symbol previously added with gtk_builder_cscope_add_callback_symbol().

    • @p callback_name is The name of the callback.
    • @r The callback symbol in @builder for @callback_name.