Ruby Tk and DRb


#1

Hello @ all!

I wrote a little test code using RubyTk and DRb. But somehow I get
strange errors:

(druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:2020:in __invoke': can't invoke "wm" command: application has been destroyed (RuntimeError) (DRb::DRbRemoteError) from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:2020:in_invoke’
from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1549:in
_ip_invoke_core' from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1583:in_tk_call_core’
from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1607:in
tk_call' from (druby://localhost:9000) /usr/lib/ruby/1.8/tk/wm.rb:271:intitle’
from client.rb:7

I don’t know why and I hope somebody can help me with this code! Here it
is:

–> SERVER.rb:

require "drb"
require "tk"

class Test
  def startup
    root = TkRoot.new('title'=>"Hallo", 'geometry'=>"200x200")
  end
end

test = Test.new
test.startup

DRb.start_service('druby://localhost:9000', test)
Tk.mainloop
DRb.thread.join

–> CLIENT.rb:

require "drb"
require "tk"

DRb.start_service()
obj = DRbObject.new(nil, 'druby://localhost:9000')

root = obj.startup

Tk.mainloop