# File gtk/sample/misc/t-gtksocket.rb, line 45 def plug(arg) if @pid != 0 Process.kill("SIGKILL", @pid) Process.waitpid(@pid) begin @table.remove(@socket) unless @socket.destroyed? rescue ArgumentError # socket has been destroyed because child process finished unexpectedly end @socket = Gtk::Socket.new @table.attach(@socket, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL, 5, 5) @socket.set_size_request(150, 190) @socket.show @xid = @socket.id end @pid = fork { exec "ruby t-gtkplug.rb -x #{@xid} Plug#{arg}" } end