GTKPerl don't execute



Why ?  some body help me?

[root draken gtkperl]# ./gtk.pl
Can't locate object method "create_menus" via package "Gnome::App" at 
./gtk.pl line 54


Script:
---- cut here
#!/usr/bin/perl -w
use strict;
use Gnome;

my $NAME = 'gCookBook';
my $VERSION = '0.1';

init Gnome $NAME;

my $app = new Gnome::App $NAME, $NAME;

signal_connect $app 'delete_event',
sub { Gtk->main_quit; return 0 };

$app->create_menus(
{
 type => 'subtree',
 label => '_File',
 subtree => [
{
type => 'item',
label => '_New',
pixmap_type => 'stock',
pixmap_info => 'Menu_New'
},
{
type => 'item',
label => '_Open...',
pixmap_type => 'stock',
pixmap_info => 'Menu_Open'
},
{
type => 'item',
label => '_Save',
pixmap_type => 'stock',
pixmap_info => 'Menu_Save'
},
{
type => 'item',
label => 'Save _As...',
pixmap_type => 'stock',
pixmap_info => 'Menu_Save As'
},
{
type => 'separator'
},
{
type => 'item',
label => 'E_xit',
pixmap_type => 'stock',
pixmap_info => 'Menu_Quit',
callback => sub { Gtk->main_quit; return 0 }
}
]
},
{
 type => 'subtree',
 label => '_Edit',
 subtree => [
{
type => 'item',
label => 'C_ut',
pixmap_type => 'stock',
pixmap_info => 'Menu_Cut',
},
{
type => 'item',
label => '_Copy',
pixmap_type => 'stock',
pixmap_info => 'Menu_Copy'
},
{
type => 'item',
label => '_Paste',
pixmap_type => 'stock',
pixmap_info => 'Menu_Paste'
 }
]
},
{
 type => 'subtree',
 label => '_Settings',
 subtree => [
{
type => 'item',
label => '_Preferences...',
pixmap_type => 'stock',
pixmap_info => 'Menu_Preferences',
callback => \&show_prefs
}
]
},
{
type => 'subtree',
label => '_Help',
subtree => [
 {type => 'item',
label => '_About...',
pixmap_type => 'stock',
pixmap_info => 'Menu_About',
callback => \&about_box
}
]
}
 );

 $app->create_toolbar(
{
 type => 'item',
 label => 'Cook',
 pixmap_type => 'stock',
 pixmap_info => 'Search',
 hint  => 'Find a recipe by ingedients'
},
{
 type  => 'item',
 label => 'Add',
 pixmap_type => 'stock',
 pixmap_info => 'Add',
 hint => 'Add a new recipe'
},
{
 type  => 'item',
 label => 'Open...',
 pixmap_type => 'stock',
 pixmap_info => 'Open',
 hint => "Open a recipe book"
},
{
type => 'item',
label => 'Save',
pixmap_type => 'stock',
pixmap_info => 'Save',
hint => "Save this recipe book"
},
{
type => 'item',
label => 'Exit',
pixmap_type => 'stock',
pixmap_info => 'Quit',
hint => "Leave $NAME",
callback => sub { Gtk->main_quit;}
}
);
 
$app->set_default_size(600,400);
 
my $bar = new Gnome::AppBar 0,1,"user" ;
$bar->set_status("");
$app->set_statusbar( $bar );
 
show_all $app;
 
main Gtk;
 
sub about_box {
my $about = new Gnome::About $NAME, $VERSION,
"(C) Simon Cozens, 2000", ["Simon Cozens"],
"This program is released under the
same terms as Perl itself";
show $about;
  }
---- cut here



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