in reply to Prima Menu
don't break your head, that's painful!
Try to spot the difference with the example from the synopsis (hint: menuItems):
use Prima; use Prima::Application; my $window = Prima::Window-> new( menuItems => [ [ '~File' => [ [ '~Open', 'Ctrl+O', '^O', \&open_file ], [ '-save_file', '~Save', km::Ctrl | ord('s'), sub { save_fi +le() } ], [], [ '~Exit', 'Alt+X', '@X', sub { exit } ], ]], [ '~Options' => [ [ '*option1' => 'Checkable option' => sub { $_[0]-> menu-> + toggle( $_[1]) }], [ '*@option2' => 'Checkable option' => sub {}], # same ]], [], [ '~Help' => [ [ 'Show help' => sub { $::application-> open_help("file://$ +0"); }], ]], ], ); sub open_file { # enable 'save' menu item $window-> menu-> save_file-> enable; } $window-> popupItems( $window-> menuItems);
bw, bliako
|
|---|