Class: Gtk::RubyBuilderScope

Inherits:
GLib::Object
  • Object
show all
Includes:
BuilderScope
Defined in:
lib/gtk4/ruby-builder-scope.rb

Instance Method Summary collapse

Instance Method Details

#virtual_do_create_closure(builder, function_name, flags, object) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/gtk4/ruby-builder-scope.rb', line 31

def virtual_do_create_closure(builder,
                              function_name,
                              flags,
                              object)
  object ||= builder.current_object || builder
  method_name = normalize_name(function_name)
  GLib::Closure.new do |*args|
    object.__send__(method_name, *args)
  end
end

#virtual_do_get_type_from_function(builder, function_name) ⇒ Object



27
28
29
# File 'lib/gtk4/ruby-builder-scope.rb', line 27

def virtual_do_get_type_from_function(builder, function_name)
  builder.__send__(normalize_name(function_name))
end

#virtual_do_get_type_from_name(builder, type_name) ⇒ Object



23
24
25
# File 'lib/gtk4/ruby-builder-scope.rb', line 23

def virtual_do_get_type_from_name(builder, type_name)
  GLib::Type.try_convert(type_name)
end