ItemFactory : how does it work ?
- From: Sylvain Daubert <sly_ ifrance com>
- To: gtk-perl-list gnome org
- Subject: ItemFactory : how does it work ?
- Date: Mon, 12 May 2003 14:00:17 +0200
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]