Class: Gtk::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi-gtk/builder.rb

Overview

Overrides for GtkBuilder

Constant Summary collapse

AFTER_FLAG =
GObject::ConnectFlags[:after]

Instance Method Summary collapse

Instance Method Details

#add_from_string_with_auto_length(buffer) ⇒ Object Also known as: add_from_string



9
10
11
# File 'lib/gir_ffi-gtk/builder.rb', line 9

def add_from_string_with_auto_length(buffer)
  add_from_string_without_auto_length buffer, buffer.length
end

#connect_signalsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gir_ffi-gtk/builder.rb', line 21

def connect_signals
  # rubocop:disable Metrics/ParameterLists
  connect_signals_full do |_, object, signal_name, handler_name, _, flags, _|
    handler = yield handler_name
    return unless handler

    if flags & AFTER_FLAG == AFTER_FLAG
      object.signal_connect_after signal_name, &handler
    else
      object.signal_connect signal_name, &handler
    end
  end
  # rubocop:enable Metrics/ParameterLists
end