Gtk2::ActionGroup problem

Hi all!

I'm trying to replace ItemFactory from an old app with UIManager, working along the example, but I can't seem to get it right:

my $uixml = <<ENDOFXML;
  <menubar name="menubar">
    <menu action="file">
      <menuitem action="quit"/>
    <menu action="script">
      <menuitem action="run"/>
    <menu action="help">
      <menuitem action="about"/>

my @uientries =
   # name,      stock id,       label
   [ "file",  undef,          "_File"               ],
   [ "script",        undef,          "_Script"     ],
   [ "help",     undef,               "_Help"         ],
   # name,      stock id,      label,    accelerator,  tooltip
[ "quit", 'gtk-quit', "_Quit", "<control>Q", "Quit", \&gscript_exit ], [ "run", 'gtk-execute', "_Run", "<control>R", "Run script", \&run ], [ "about", 'gtk-help', "_About", undef, "About", \&gscript_about ],

sub gscript_create_menubar2 {
    my ($win) = @_;

    my $actions = Gtk2::ActionGroup->new("Actions");
    $actions->add_actions (\ uientries, undef);

    my $ui = Gtk2::UIManager->new;
    $ui->insert_action_group($actions, 0);

    return $ui->get_widget("/menubar");

The add_actions() barfs "action array is empty" at me. Any idea what could be wrong?


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