ItemFactory : how does it work ?



Hi all,

I have a problem with ItemFactory : a menubar is created but it is empty (no item appears on it).

I tried this :



Gtk2->init;
Gnome2::Program->init('test', '0.1', 'libgnomeui');

my ($form);

$form->{'app_gwine'} = Gnome2::App->new('test', 'test');
$form->{'app_gwine'}->set_size_request(300,200);

# Get an accelgroup
$form->{'accel_group'} = Gtk2::AccelGroup->new;

# Construct Main Menu
my $itemfac = Gtk2::ItemFactory->new('Gtk2::MenuBar', 
                                     '<GwineMain>', 
                                     $form->{'accel_group'});
$itemfac->create_items([
                        ['/_File', undef, undef, 0, '<Branch>'],
                        ['/File/_Quit', undef, undef, 0, '<StockItem>', 'gtk-exit']
                       ]);
$form->{'menubar1'} = $itemfac->get_widget('<GwineMain>');
$form->{'app_gwine'}->set_menus($form->{'menubar1'});

# Construct content
$form->{'hpaned'} = Gtk2::HPaned->new;
$form->{'app_gwine'}->set_contents($form->{'hpaned'});

# Add accel group
$form->{'app_gwine'}->add_accel_group($form->{'accel_group'});

$form->{'app_gwine'}->show_all;

Gtk2->main;


I use gtk2-perl-xs from CVS (last compilation from saturday).
Could anybody help me ?

Regards,

Sylvain
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France




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