Class: RubyCurses::Io::CMenuItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/rbcurse/core/include/io.rb

Overview

def add_item hotkey, label, desc,action

A simple way of creating menus that will appear in a single row. This copies the menu at the bottom of “most” upon pressing “:”. hotkey is the key to invoke an item (a single digit letter)

label is an action name

desc is a description displayed after an item is chosen. Usually, its like: + “Folding has been enabled” or “Searches will now be case sensitive”

action may be a Proc or a symbol which will be called if item selected + action may be another menu, so recursive menus can be built, but each + should fit in a line, its a simple system.

Instance Attribute Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



280
281
282
# File 'lib/rbcurse/core/include/io.rb', line 280

def action
  @action
end

#descObject

Returns the value of attribute desc

Returns:

  • (Object)

    the current value of desc



280
281
282
# File 'lib/rbcurse/core/include/io.rb', line 280

def desc
  @desc
end

#hotkeyObject

Returns the value of attribute hotkey

Returns:

  • (Object)

    the current value of hotkey



280
281
282
# File 'lib/rbcurse/core/include/io.rb', line 280

def hotkey
  @hotkey
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



280
281
282
# File 'lib/rbcurse/core/include/io.rb', line 280

def label
  @label
end