>It now works for the little test case H.Yamamoto wrote, but still
>fails in our code with the same bgerror problem as before.

Maybe because second argument of TclTkIp.new is nil?

>from [ruby-talk:139390]:

>>   def initialize(name = 'default')
>>     @interp = TclTkIp.new(name, nil) #nil disables tk
>>   end

////////////////////////////////

require 'tk'
ip = TclTkIp.new('hoge', '')
p ip._invoke('tk_optionMenu', '.om', 'OM', '"Option 1" "Option 2" "Option 3" "Option 4"')

E:\ruby-cvs\win32>ruby19 \d.rb
".om.menu"

////////////////////////////////

require 'tk'
ip = TclTkIp.new('hoge', nil)
p ip._invoke('tk_optionMenu', '.om', 'OM', '"Option 1" "Option 2" "Option 3" "Option 4"')

E:\ruby-cvs\win32>ruby19 \d.rb
E:/ruby-cvs/win32/.ext/tk.rb:2020:in `_invoke': invalid command name "tk_optionM
enu" (RuntimeError)
        from E:/ruby-cvs/win32/.ext/tk.rb:2020:in `_invoke'
        from /d.rb:4