From: Hidetoshi NAGAI Date: 2005-04-28T12:29:19+09:00 Subject: Re: tk_optionMenu bug in 1.8.2 From: H.Yamamoto Subject: Re: tk_optionMenu bug in 1.8.2 Date: Thu, 28 Apr 2005 03:11:54 +0900 Message-ID: <20050428031134.FBC63B30.ocean@m2.ccsnet.ne.jp> > I couldn't reproduce the same error, but another error occured. > 1. click any of the two add buttons on the left side > 2. click Cancel button in opened window > 3. following error is reported > RuntimeError: window ".w00087" was deleted before its visibility changed "wait_visibility" is a little danger. When the target widget had be finished to change its visibility, the command may lock the application. One of the more safe ways is to use Tk.after method. For example, ------------------------------------------ top = TkToplevel.new{ withdraw } Tk.after(100){ ... create widgets on the widget 'top' ... top.deiconify } top.wait_visibility. ------------------------------------------ Or one of the others is to use thread. For example, ------------------------------------------ top = TkToplevel.new{ withdraw } th = Thread.new{top.wait_visibility}.run # force context switch ... create widgets on the widget 'top' ... top.deiconify th.join ------------------------------------------ Please ensure that visibility change is occured after calling 'wait_visibility'. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)