CORBA-MICO

 view release on metacpan or  search on metacpan

ccc/CMenu.pm  view on Meta::CPAN

  if( not exists($items->{$path}) ) {
    $curr_item = { 'TYPE' => $type };
    $items->{$path} = $curr_item;
    my $action = ($type eq 'Item') ? ++$self->{'LAST_ACTION'} : 0;
    $curr_item->{'ACTION'} = $action;
    if( $path =~ m#(^/.*)/[^/]*$# ) {    # dirname
      $self->prepare_item('', $1, undef, 'Branch', undef, undef);
    }  
    my $selfptr = $self->{'SELFPTR'};
    $type = 'LastBranch' if $path =~ m#^/_?Help$#i;
    my $cdata = [$path, $hotkey, undef, $action, "<$type>"];
    if( $type =~ /Item/ ) {
      $cdata->[2] = sub { item_activated_cb($selfptr, $curr_item, @_) };
    }
    $self->{'FACTORY'}->create_item($cdata);
  }
  else {
    $curr_item = $items->{$path};
    if( $curr_item->{'TYPE'} ne $type ) {
      carp "$self->{MENU_NAME}:$path already defined as a $type";
      return undef;
    }
  }
  if( $id and exists($curr_item->{$id}) ) {
    carp "ID $id already defined in menu item $self->{MENU_NAME}:$path";



( run in 0.249 second using v1.01-cache-2.11-cpan-454fe037f31 )