Class: RubyCurses::ItemEvent
- Inherits:
-
Object
- Object
- RubyCurses::ItemEvent
- Defined in:
- lib/rbcurse/rwidget.rb
Overview
an event fired when an item that can be selected is toggled/selected
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
the item pressed such as toggle button.
-
#item_first ⇒ Object
readonly
if from a list.
-
#item_last ⇒ Object
readonly
Returns the value of attribute item_last.
-
#item_selectable ⇒ Object
readonly
item originating event such as list or collection.
-
#param_string ⇒ Object
readonly
for debugging etc.
- #state ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(item, item_selectable) ⇒ ItemEvent
constructor
i think only one is needed per object, so create once only.
- #set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
Constructor Details
#initialize(item, item_selectable) ⇒ ItemEvent
i think only one is needed per object, so create once only
2404 2405 2406 2407 |
# File 'lib/rbcurse/rwidget.rb', line 2404 def initialize item, item_selectable @item, @item_selectable = item, item_selectable end |
Instance Attribute Details
#item ⇒ Object (readonly)
the item pressed such as toggle button
2391 2392 2393 |
# File 'lib/rbcurse/rwidget.rb', line 2391 def item @item end |
#item_first ⇒ Object (readonly)
if from a list
2393 2394 2395 |
# File 'lib/rbcurse/rwidget.rb', line 2393 def item_first @item_first end |
#item_last ⇒ Object (readonly)
Returns the value of attribute item_last.
2394 2395 2396 |
# File 'lib/rbcurse/rwidget.rb', line 2394 def item_last @item_last end |
#item_selectable ⇒ Object (readonly)
item originating event such as list or collection
2392 2393 2394 |
# File 'lib/rbcurse/rwidget.rb', line 2392 def item_selectable @item_selectable end |
#param_string ⇒ Object (readonly)
for debugging etc
2395 2396 2397 |
# File 'lib/rbcurse/rwidget.rb', line 2395 def param_string @param_string end |
#state ⇒ Object (readonly)
2390 2391 2392 |
# File 'lib/rbcurse/rwidget.rb', line 2390 def state @state end |
Instance Method Details
#set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
2408 2409 2410 2411 2412 |
# File 'lib/rbcurse/rwidget.rb', line 2408 def set state, item_first=-1, item_last=-1, param_string=nil @state, @item_first, @item_last, @param_string = state, item_first, item_last, param_string @param_string = "Item event fired: #{item}, #{state}" if param_string.nil? end |