Menu

#1 itemfact oryin gtk-0.27

closed-fixed
ruby-gnome (11)
7
2002-03-15
2002-03-13
Anonymous
No

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

Discussion

  • Neil Conway

    Neil Conway - 2002-03-15
    • labels: --> ruby-gnome
    • priority: 5 --> 7
    • assigned_to: nobody --> klamath
    • status: open --> closed-fixed
     
  • Neil Conway

    Neil Conway - 2002-03-15

    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?

     
  • Nobody/Anonymous

    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.

     
  • Nobody/Anonymous

    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.

     

Log in to post a comment.