From: Hidetoshi NAGAI Date: 2005-10-24T12:45:55+09:00 Subject: Re: Ruby/Tk question From: "Glenn M. Lewis" Subject: Re: Ruby/Tk question Date: Sun, 23 Oct 2005 09:22:00 +0900 Message-ID: > Yes indeed... you are exactly right. Thank you! > I found Tk.restart, and tried it out, and it worked > for the most part, but when the window was rebuilt, > the scrollbars no longer worked. Hmm... Probably, some part of the interpreter will not be able to initialize. "Tk.restart" calls Tcl/Tk's C API "Tk_Init". If the C function fails to work, it may be hard to rescue the trouble on re-initialization. > Do you know of another workaround? If you want to some modal windows, you should use toplevel widgets (And hide the root widget by Tk.root.withdraw, if you need it). Or, if you want protect the window from close operation by user, please use TkRoot#protocol method. For example, -------------------------------------------------------- Tk.root.protocol('WM_DELETE_WINDOW'){ # operation to manage WM_DELETE_WINDOW protocol exit if Tk.messageBox(:type=>'okcancel', :message=>'Realy?') == 'ok' } -------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)