Sha256: bc276fbfe52d73bc208b715c50e75412268b7390b183fd09490c0499ed41e0a9

Contents?: true

Size: 341 Bytes

Versions: 1

Compression:

Stored size: 341 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require "newt"

begin

  Newt::Screen.new

  l1 = Newt::Listbox.new(1, 1, 10, Newt::FLAG_SCROLL)
  1.upto(20) do |i|
    l1.append("item #{i}", i)
  end

  b = Newt::Button.new(1, 12, "Exit")

  f = Newt::Form.new
  f.add(l1, b)

  f.run()

  v = l1.get_current

ensure
  Newt::Screen.finish
end

p v

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
newt-0.9.7 examples/test_method/Listbox_get_current.rb