Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pop-up button notifications




On Jun 13, 2007, at 3:15 AM, Godwin, Mark R wrote:

Hi All,

I need to get a notification from a pop-up button when it has been changed, i.e. when the user selects an item from the pop-up button’s menu, but I don’t want to use the ‘Command’ generated from the menu item itself (as they are dynamically genereated, and don’t have Commands). Instead, I want the index of the item selected and the Pop-up control ref to identify the control.

I’ve experimented with the kEventMenuClosed event, which seems to almost work, but the Control Value of the control when this event is processed has not been updated to the new value yet.

I assume there must be an event, (in kEventClassControl?) which the control itself is handling to know when to redraw, change the active item, etc., but I can’t find out what that message is. I’m guessing I have to install an event handler for this message, and then call CallNextEventHandler() to pass the message through to the control, before calling GetControl32BitValue() to get the updated value.

You should be able to use a kEventControlHit event handler on the popup button control. When you get that event, call GetControl32BitValue to get the value of the control; the control value corresponds to the index of the selected menu item.


-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Pop-up button notifications (From: "Godwin, Mark R" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.