Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Saturday, March 23 2019 @ 11:07 PM UTC

Why don't my popup menus work?

Carbon Development FAQHave a popup menu control that shows its popup, but when you select a menu item, the control doesn't notice the change?

If your popup menu controls suddenly don't change their selection (and value) in response to a menu selection, there are two reasons why this may be so:

1) You added the menu items dynamically, and forgot to call SetControlMaximum(CountMItems(theMenu)) and hence, SetControlValue() restricts the value to zero, or the number of items originally in the menu.

2) You have a Carbon event handler that handles kEventProcessCommand Carbon Events and always returns noErr. Carbon event handlers installed on the application or the window are also called when menus in popup menu controls are selected, and when a Carbon event handler returns noErr, it means "everything OK, I've taken care of this event, no need to have anyone else handle it".

But for menu items that your handler doesn't really handle, it should instead return eventNotHandledErr, to give someone higher up in the calling chain the opportunity to handle the menu selection, like a popup menu control.

What's Related

Story Options

Why don't my popup menus work? | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2019 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.06 seconds