Class: RubyCurses::ItemEvent
- Defined in:
- lib/rbcurse/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
3065 3066 3067 3068 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3065 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
3052 3053 3054 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3052 def item @item end |
#item_first ⇒ Object (readonly)
if from a list
3054 3055 3056 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3054 def item_first @item_first end |
#item_last ⇒ Object (readonly)
3055 3056 3057 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3055 def item_last @item_last end |
#item_selectable ⇒ Object (readonly)
item originating event such as list or collection
3053 3054 3055 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3053 def item_selectable @item_selectable end |
#param_string ⇒ Object (readonly)
for debugging etc
3056 3057 3058 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3056 def param_string @param_string end |
#state ⇒ Object (readonly)
3051 3052 3053 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3051 def state @state end |
Instance Method Details
#set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
3069 3070 3071 3072 3073 |
# File 'lib/rbcurse/core/widgets/rwidget.rb', line 3069 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 |