Module: Gtk

Defined in:
gtk3/lib/gtk3.rb,
gtk4/lib/gtk4.rb

Defined Under Namespace

Classes: Error, InitError

Constant Summary collapse

LOG_DOMAIN =
"Gtk"

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



34
35
36
37
38
39
40
41
# File 'gtk3/lib/gtk3.rb', line 34

def const_missing(name)
  init()
  if const_defined?(name)
    const_get(name)
  else
    super
  end
end

.init(*argv) ⇒ Object



52
53
54
55
56
57
58
59
60
61
# File 'gtk3/lib/gtk3.rb', line 52

def init(*argv)
  class << self
    remove_method(:init)
    remove_method(:const_missing)
    remove_method(:method_missing)
  end
  Gdk.init if Gdk.respond_to?(:init)
  loader = Loader.new(self, argv)
  loader.load
end

.method_missing(name, *args, &block) ⇒ Object



43
44
45
46
47
48
49
50
# File 'gtk3/lib/gtk3.rb', line 43

def method_missing(name, *args, &block)
  init()
  if respond_to?(name)
    __send__(name, *args, &block)
  else
    super
  end
end