Module: GtkApp::SignalSupport::InstanceMethods

Defined in:
lib/gtk_app/signal_support.rb

Instance Method Summary collapse

Instance Method Details

#establish_signal_connectionsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/gtk_app/signal_support.rb', line 33

def establish_signal_connections
  return unless self.class.signal_connections

  self.class.signal_connections.each do |signal_connection|
    signal_connection.with do |conn|
      widget = @view.send conn.widget_name
      if conn.receiver_block
        widget.signal_connect conn.signal_name do |*args|
          self.instance_exec(*args, &conn.receiver_block)
        end
      else
        widget.signal_connect conn.signal_name do |*args|
          self.send conn.receiver_method_name, *args
        end
      end
    end
  end
end