When I use Gkt::ItemFactory, error occured.
%cat test.rb
#!/usr/bin/ruby
require "gtk"
accel = Gtk::AccelGroup.new
# Main Menu
itemfact =
Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR,
"<main>", accel)
itemfact.create_item("/Test", nil,
Gtk::ItemFactory::BRANCH)
itemfact.create_item("/Test/1", nil,
Gtk::ItemFactory::ITEM){|w| p w}
box = Gtk::VBox.new
box.pack_start(itemfact.get_widget("<main>").show,false,true,0)
# Main Window
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
accel.attach(window)
window.add(box)
window.show_all
# main loop
Gtk.main
%ruby test.rb
test.rb:24:in `main': undefined method `call' for
#<Gtk::ItemFactory:0x2accb600> (NameError)
from test.rb:24
I think rbgtkitemfactory.c has wrong.
item_exec_callback_wrap(p_item, iter) # wrong
item_exec_callback_wrap(p_item, ifact, iter) # right
Logged In: YES
user_id=11779
Thanks for reporting this. The fix has been checked into
CVS, and it will appear in the 0.28 release which should be
out shortly.
BTW, I've added your sample file to the sample/ directory.
Is that okay?
Logged In: NO
> I've added your sample file to the sample/ directory. Is
that okay?
Yes, you can use the sample and change that.
Logged In: NO
> I've added your sample file to the sample/ directory. Is
that okay?
Yes, you can use the sample and change that.