$h={
 "A" => %w{A B C D E F},
 "B" => %w{G H I J K L},
 "C" => %w{M N O P Q R},
 "D" => %w{S T U V W X Y Z}
}
$reverseh= $h.inject({}) { |h,(k,a)| a.each {|l| h[l]=k } ; h }

def wconv(word)
 word.chomp.upcase.split(//).map { |l| $reverseh[l]||l}.join("")
end

require 'Ruiby'
Ruiby.app :width=>200,:height=>50  do
  stack {
    flow { label(" Word ?") ; @e=entry("")  ; space}
    space
    separator
    flow {
        button("Translate please") { alert( wconv(@e.text)) if 
@e.text.size>0 }
        button("Exit") { exit!(0) }
    }
  }
end

-- 
Posted via http://www.ruby-forum.com/.