Ruby Tk and DRb

A

Alex Piel

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:in
`title'
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top