Hello,

I have this code in an open event of a PopupMenu control:

dim pb as NSPopUpButtonMBS=me.NSPopUpButtonMBS 
dim menu as NSMenuMBS=pb.menu 
dim MenuItem As NSMenuItemMBS

for i as integer=0 to menu.numberOfItems-1
  MenuItem=menu.Item(i)
  if MenuItem<>nil and MenuItem.Title="Test" then
    MenuItem.Enabled=False
  end if
next

Putting a breakpoint in the “MenuItem.Enabled=False” line, I’m seeing the 
statement is executed. However, the item is always enabled.

I can’t use the CarbonApplicationEvents class either (MenuPopulate event) 
because the obtained NSMenuMBS, given the passed handle, looks invalid (when 
using Menu.NumberOfItems, I get a CocoaException). As it’s for 64 bit, I can’t 
either use the MenuMBS way.

What is the workaround?
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to