將Perl\Tk改成Ruby\Tk
Perl\Tk版:http://www.wretch.cc/blog/cfcef&article_id=3586468
  require 'tk'
  tmptext=TkVariable.new
  def show(str)
    configure("text"=>str)
  end
  TkButton.new(){
    text "HI"
    command {proc show(tmptext.value)}
    pack("padx"=>5)
  }
  entry=TkEntry.new("textvariable"=>tmptext){
  pack("padx"=>10)
  }
  Tk.mainloop

zusocfc 發表在 PIXNET 痞客邦 迴響(0) 引用(0) 人氣(155)