Hi All,

I am trying to code Chevron menus and am running into trouble with RemoveMenu().
The code below should work, but alas, it does not remove any of the menu items and the full
menu is displayed off the Rebar Chevron no matter how may items I attempt to remove.

Note: I AM calling DrawMenuBar after modifying the menu.

Does anyone have any experience or advice on this issue?

#------------------------------------------------------------------------------

sub Rebar_ChevronPushed {

  my($bandIndex, $left, $top, $right, $bottom) = @_;
  my %band = $main->Rebar->GetBandInfo($bandIndex);
  my $toolbar = $band{-child}; #Handle to Rebar Band Child..

  say "Rebar Band Child Handle: ", $toolbar if $DEBUG;
  my $buttonCount  = Win32::GUI::Toolbar::ButtonCount($toolbar);
  my $toolbarWidth = Win32::GUI::Width($toolbar);
  say "Button Count: ", $buttonCount if $DEBUG;

  foreach my $index(1..$buttonCount){
    my ($left, $top, $right, $bottom) =
      Win32::GUI::Toolbar::GetRect($toolbar, $index);
    if ($right > $toolbarWidth) {
      say "Button ", $index, " is Hidden" if $DEBUG;
      say join(", ", Win32::GUI::Toolbar::GetRect($toolbar, $index)) if $DEBUG;
    } else {
      say "Removing Menu Position: ", $index - 1;
      $toolbarMenus->RemoveMenu($index - 1, MF_BYPOSITION);
    }
  }
  $main->Rebar->DrawMenuBar();
  say "Chevron on Band ", $bandIndex, " pushed... Pop a menu!" if $DEBUG;
  my $menu = $toolbarMenus->{Toolbar};
  $main->TrackPopupMenu(
                        $menu,
                        $main->ClientToScreen($left, $bottom),

                       );

return 0;

}

#------------------------------------------------------------------------------

TIA!

David J. Keith
Application Developer
Latham International ● 787 Watervliet-Shaker Rd. ● Latham, NY 12110
Office: 518.951.1063