Class: Gtk::BuilderCScope

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtk::BuilderCScope

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

Instance Method Details

#add_callback_symbol(callback_name, callback_symbol) ⇒ nil

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.

Parameters:

  • callback_name (String)

    The name of the callback, as expected in the XML

  • callback_symbol (GObject::Callback)

    The callback pointer

Returns:

  • (nil)

#add_callback_symbols(first_callback_name, first_callback_symbol, array) ⇒ nil

A convenience function to add many callbacks.

This is equivalent to calling [methodGtk.BuilderCScope.add_callback_symbol] for each symbol.

Parameters:

  • first_callback_name (String)

    The name of the callback, as expected in the XML

  • first_callback_symbol (GObject::Callback)

    The callback pointer

  • array (Array)

    A list of callback name and callback symbol pairs terminated with nil

Returns:

  • (nil)

#lookup_callback_symbol(callback_name) ⇒ GObject::Callback

Fetches a symbol previously added with gtk_builder_cscope_add_callback_symbol().

Parameters:

  • callback_name (String)

    The name of the callback

Returns:

  • (GObject::Callback)

    The callback symbol in builder for callback_name