Sha256: f3484b9151fc5a957edf8072182ba703029edac094ffd44157b184781faa4888

Contents?: true

Size: 541 Bytes

Versions: 1

Compression:

Stored size: 541 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require "newt"

begin
  TEXTBOX_NORMAL = Newt::COLORSET_CUSTOM 1
  TEXTBOX_ACTIVE = Newt::COLORSET_CUSTOM 2

  Newt::Screen.new
  Newt::Screen.set_color(TEXTBOX_NORMAL, "black", "red")
  Newt::Screen.set_color(TEXTBOX_ACTIVE, "white", "red")

  t = Newt::Textbox.new(1, 1, 20, 10, Newt::FLAG_WRAP)
  t.set_colors(TEXTBOX_NORMAL, TEXTBOX_ACTIVE)
  t.set_text("Line1\nLine2\nLine3")

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

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

  f.run()

ensure
  Newt::Screen.finish
end

Version data entries

1 entries across 1 versions & 1 rubygems

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