require "phi" ; include Phi
require "pstore"

form = Form.new
label1 = Label.new form, :label1 , "終了時の内容を保存、復活します"
edit1 = Edit.new form, :edit1
label1.top = 20
edit1.top = 40

ps = PStore.new('c:/test.ps')
form.on_close = proc{
  ps.transaction{|ps|
    ps["test"] = form.edit1.text
  }
}

ps.transaction{|ps|
  form.edit1.text = ps["test"] if ps.root?("test")
}

form.show
Phi::mainloop
