From: Richard Zidlicky Date: 2003-06-12T00:57:58+09:00 Subject: fork and Tk problem --UugvWAfsgieZRqgk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by funfun.nagaokaut.ac.jp id h5BFw7w31466 Hi, I have noticed a little strangeness, a mere 'require "tkscrollbox"' before a fork will cause weird effects even if all Tk objects are created *after* the fork. Eg exiting the process which created the Tk objects doesn=B4t destroy them and using explicit $top.withdraw sometimes causes even X server hickup. Doing the "require" after the fork leads to correct behaviour, this is ruby-1.6.7 on Redhat 8.0. Is it a known problem? I have attached the small testprog that demonstrates the trouble. Richard --UugvWAfsgieZRqgk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=forktest #!/usr/bin/ruby def helper finish=nil trap("SIGINT"){finish=1} ctr=0 loop{ ctr += 1 exit if finish and ctr>2 sleep 20 } end def start_helper $lpid=fork{helper} end def quit(something) #$top.withdraw Process.kill("SIGINT",$lpid) exit end def build_gui $top = TkRoot.new TkButton.new($top) { text 'Quit' command "quit 'quit-button'" pack('fill'=>'both','expand'=>'yes','side'=>'left') } end ## main program ## # require must come after start_helper, else Tk resources are shared ?! require "tkscrollbox" start_helper build_gui Tk.mainloop --UugvWAfsgieZRqgk--