Forum: Ruby Ruby Tk and DRb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bab383f41b560863c107dd46c1cf9092?d=identicon&s=25 Alex Piel (alexmaster)
on 2005-12-05 11:05
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
This topic is locked and can not be replied to.