class Iup::List

A dynamic control presenting a list of options to the user. The list may be visible, or a hidden, drop-down list. Optionally, items may be editable.

Example

(1) Simple list, responding to double-click selection:

Iup::List.new do |l|
  l.item(1, "Java")
  l.item(2, "Ruby")
  l.item(3, "Scheme")
  l.spacing = 4
  l.size = "80x100"
  l.dblclick_cb = ->(index, text) {
    puts "DBL CLICK ON #{index} with #{text}"
    Iup::DEFAULT
  }
end

(2) Dropdown list, responding to changes in value:

Iup::List.new do |l|
  l.item(1, "Java")
  l.item(2, "Ruby")
  l.item(3, "Scheme")
  l.spacing = 4
  l.dropdown = 'yes'
  l.valuechanged_cb = ->{
    puts "New value index is #{l.value}, text is #{l.item(l.value)}"
    Iup::DEFAULT
  }
end

Note that the C implementation of Iup’s list is 1-indexed: this is preserved in the wrapped version, for consistency.