Module Responder2 |
|
The Responder2 module provides the connect method, which is mixed-in to all classes that have a message target (i.e. Fox::FXDataTarget, Fox::FXRecentFiles and Fox::FXWindow).
Methods |
Public Instance methods |
connect(messageType, callableObject=nil, &block) |
Assign a "handler" for all FOX messages of type messageType sent from this widget. When called with only one argument, a block is expected, e.g.
aButton.connect(SEL_COMMAND) { |sender, selector, data| ... code to handle this event ... }
The arguments passed into the block are the sender of the message (i.e. the widget), the selector for the message, and any message-specific data.
When connect is called with two arguments, the second argument should be some callable object such as a Method or Proc instance, e.g.
aButton.connect(SEL_COMMAND, method(:onCommand))
As with the one-argument form of connect, the callable object will be "called" with three arguments (the sender, selector and message data).