Building menu



        Hello,

        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;
        $om->set_menu($menu);

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

        When I run this code the answer is :

variable must be a reference to an array of Gnome UI Info Entries at ./oladm2.pl 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 ./oladm2.pl 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]