Building menu


        I need your help again...

I am trying to build an option menu. Everything is ok until I try to append the MenuItem to the Menu. The code is :

        my $om = Gtk2::OptionMenu->new;
        my $menu = Gtk2::Menu->new;

        my $item = Gtk2::MenuItem->new_with_label('foo');

        When I run this code the answer is :

variable must be a reference to an array of Gnome UI Info Entries at ./ line 360, <DATA> line 422.

When I look at the Gtk2 docs, it says that append is deprecated. I don't know what replaces it but when I try 'attach', like this :

        $menu->attach($item, 0, 1, $cnt, $cnt+1);

        this time the answer is :

Usage: Gtk2::Menu::attach(popup, widget, user_data=NULL) at ./ line 360, <DATA> line 422.

and that does not look at all like the prototype shown in Gtk doc or Gtk2-Perl doc...

        How can I do ?

        Thanks !
 -/ O \----------------------------------------
| |/ \|       Alexandre (Midnite) Jousset      |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]