Class: RubyCurses::ItemEvent
- Defined in:
- lib/rbhex/core/widgets/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
-
#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
3070 3071 3072 3073 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3070 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
3057 3058 3059 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3057 def item @item end |
#item_first ⇒ Object (readonly)
if from a list
3059 3060 3061 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3059 def item_first @item_first end |
#item_last ⇒ Object (readonly)
3060 3061 3062 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3060 def item_last @item_last end |
#item_selectable ⇒ Object (readonly)
item originating event such as list or collection
3058 3059 3060 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3058 def item_selectable @item_selectable end |
#param_string ⇒ Object (readonly)
for debugging etc
3061 3062 3063 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3061 def param_string @param_string end |
#state ⇒ Object (readonly)
3056 3057 3058 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3056 def state @state end |
Instance Method Details
#set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
3074 3075 3076 3077 3078 |
# File 'lib/rbhex/core/widgets/rwidget.rb', line 3074 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 |