Best way to make a "Gnome" popup menu?



I can make a popup menu with straight Gtk but as my application is a Gnome app
I'd like to use Gnome stock icons and such on the menu. 

In the Gnome documentation there's a section called gnome-popup-menu
(http://developer.gnome.org/doc/API/libgnomeui/gnomeui-gnome-popup-menu.html)
but I've dug through the Gtk-Perl source and can't find any bindings for subs
such as gnome_popup_menu_new and it's related subroutines that allow you to
create a popup menu from a GnomeUIInfo (like $app->create_menus).

But, I did see bindings for gnome_app_fill_menu so I thought I could do
something like this:


# Define the menu structure
my $menu = [
            {type => 'item',
             label => 'Edit Description ...',
             pixmap_type => 'stock',
             pixmap_info => 'Menu_Edit',
             callback => \&show_edit_desc_dialog}, 
            {type => 'item',
             label => 'Insert Photo ...',
             pixmap_type => 'stock',
             pixmap_info => 'Add',
             callback => \&show_add_photos_dialog}, 
            {type => 'item',
             label => 'Remove Photo ...',
             pixmap_type => 'stock',
             pixmap_info => 'Remove',
             callback => \&remove_photo} 
           ];

# Create the menu
my $popup = new Gtk::Menu;
Gnome::App->fill_menu($popup, $menu, undef, FALSE, 0);
$popup->show_all;

# Pop it up
$popup->popup(undef, undef, 0, $event->{button}, undef);

But that doesn't work. Any ideas on how to do this?

Thanks,

Jason


--
Jason Bodnar
jason shakabuku org
http://www.shakabuku.org




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