class PPCurses::Responder
Based on the Cocoa NSResponder
Current link, which probably won't be valid in the future …
Attributes
Public Class Methods
# File lib/ppcurses/application.rb, line 55 def Responder.isa( obj ) PPCurses.implements_protocol( obj, %w(accepts_first_responder become_first_responder resign_first_responder key_down)) end
Public Instance Methods
Whether the responder accepts first responder status.
As first responder, the receiver is the first object in the responder chain to be sent key events and action messages. By default, this property is NO. Subclasses set this property to YES if the receiver accepts first responder status.
# File lib/ppcurses/application.rb, line 20 def accepts_first_responder NO end
Notifies the receiver that it’s about to become first responder
The default implementation returns YES, accepting first responder status. Subclasses can override this method to update state or perform some action such as highlighting the selection, or to return NO, refusing first responder status.
# File lib/ppcurses/application.rb, line 31 def become_first_responder YES end
Informs the receiver that the user has pressed a key.
The default implementation simply passes this message to the next responder.
# File lib/ppcurses/application.rb, line 51 def key_down( key ) @next_responder.key_down(key) unless @next_responder.nil? end
Notifies the receiver that it’s been asked to relinquish its status as first responder in its window.
The default implementation returns YES, resigning first responder status. Subclasses can override this method to update state or perform some action such as unhighlighting the selection, or to return NO, refusing to relinquish first responder status.
# File lib/ppcurses/application.rb, line 42 def resign_first_responder YES end