my_text_field = nil Shoes.app :title => "Dict.org",:height => 400, :width => 600 do background rgb(0xd9, 0x51, 0x95) stack :margin => 10 do word = para "" my_text_field = edit_box("",:width => 550,:height => 300) previous_clipboard = "" Thread.new { while true sleep 1 clipboard = self.clipboard if previous_clipboard != clipboard my_text_field.text = IO.popen("dict #{self.clipboard}").read word.replace(clipboard) end previous_clipboard = clipboard end } end end