From: Hidetoshi NAGAI Date: 2005-04-26T10:26:26+09:00 Subject: Re: tk_optionMenu bug in 1.8.2 Hi, From: Brett Williams Subject: tk_optionMenu bug in 1.8.2 (WAS: Re: ruby tk: ruby 1.8.2 bug in TclTkIp with "exit 0" ... ? ) Date: Tue, 26 Apr 2005 02:04:28 +0900 Message-ID: <1114448454.321968@cswreg.cos.agilent.com> > I have another one which is proving much more difficult to lock down, as > it doesn't recreate in a simple test case. > > Do you know any reason why I might get the following when using a > TkOptionMenuButton: > > bgerror failed to handle background error. > Original error: NameError: invalid command name `tk_optionMenu' > Error in bgerror: invalid command name "bgerror" This is a kind of autoload trouble on Tcl/Tk. On some commands, TclTkIp._invoke fails to autoload. # In your case, fails to autoload 'bgerror' also. TclTkIp._eval doesn't fail to autoload. Probably, the following can hide the trouble. ----------------------------- begin TkOptionMenubutton.new(....) rescue NameError begin TkCore::INTERP._eval('tk_optionMenu') rescue end retry # or call TkOptionMenubutton.new(....) end ----------------------------- Yes. Of course I know that is NOT good. However, if I cannot find better way to avoid the autoload trouble, I may apply similar patch to tk/menu.rb. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)