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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top