Re: A problem with PopupButtonCell --- submenu selection not available

2010-07-05 Thread Graham Cox
On 06/07/2010, at 12:31 AM, Motti Shneor wrote: > One catch though... In my situation, the menus, sub-menus and items are > prepared in advance, somewhere-else-in-the-code, where I don't yet know the > target and action. > These are only available for me when I'm actually activating the menu.

Re: A problem with PopupButtonCell --- submenu selection not available

2010-07-05 Thread Motti Shneor
Hello Graham, and thanks a million. That's exactly where i stand. I don't have a control, only a cell, and I can hardly use the [NSMenu popUpContextMenu] because its visual appearance is different than the desired PopUpButtonCell. My whole situation is 100% programmatic, no IB or NIB or XIB fil

Re: A problem with PopupButtonCell --- submenu selection not available

2010-07-05 Thread Graham Cox
On 05/07/2010, at 9:32 PM, Motti Shneor wrote: > resultIndex = [popUpButtonCell indexOfSelectedItem]; returns -1 (unknown) > result = [popUpButtonCell selectedItem]; returns nil! > > How can I resolve this thing? I MUST have popup menus with sub-menus! Is > there a hidden member or method that

Re: A problem with PopupButtonCell --- submenu selection not available

2010-07-05 Thread Ron Fleckner
On 05/07/2010, at 9:32 PM, Motti Shneor wrote: > This works nicely until the menu has submenus. If a user selects an > item that belongs to a submenu --- then > > resultIndex = [popUpButtonCell indexOfSelectedItem]; returns -1 (unknown) > result = [popUpButtonCell selectedItem]; returns n

A problem with PopupButtonCell --- submenu selection not available

2010-07-05 Thread Motti Shneor
Hello everyone. I need to programmatically place a Popup-Menu (Pulldown) on an arbitrary place in my custom view, and collect user selection. I have done this by creating a category for the NSMenu object - like this // This category adds a generic popup-menu capability to NSMenu. @interface NSM