This is probably due to some internal working with TkVariables, but can someone
enlighten me as to why this won't work?

[test2.rb]
require 'pstore'
require 'tk'

db = PStore.new("temp")
test = nil
db.transaction {
  test = db.root?("foo") ? db["foo"] : TkVariable.new
}

puts "type: #{test.type}"
puts "value: #{test.value}"

test.value = "hello world"
db.transaction {
  db["foo"] = test
}

normsu[116]$ ruby test2.rb
type: TkVariable
value:
normsu[117]$ ruby test2.rb
type: TkVariable
/usr/local/lib/ruby/1.6/tk.rb:977:in `_eval': can't read "v00000": no such
variable (RuntimeError)
        from /usr/local/lib/ruby/1.6/tk.rb:977:in `_eval'
        from /usr/local/lib/ruby/1.6/tk.rb:1160:in `value'
        from test2.rb:11
normsu[118]$ ruby -v
ruby 1.6.7 (2002-03-01) [i686-cygwin]

Thanks,

--
Norman Makoto Su