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: Data Browser selection order



Quoting Erik Allen <email@hidden>:

I have a list in a data browser control that is set to only allow one
thing to be selected at a time. It has a DataBrowserItemNotificationUPP
attached to it so I can keep track of the kDataBrowserItemSelected and
kDataBrowserItemDeselected events.


...

The problem is that the events are happening in the opposite order of what
I expected. When the first item is selected in the list, I get the
kDataBrowserItemSelected correctly. When a second item in the list is
selected, I get another kDataBrowserItemSelected (which causes the process
to enable the other controls and populate them) followed by a
kDataBrowserItemDeselected (which causes the other controls to be
disabled.) So after the first item is selected, nothing else is getting
enabled.


I have run into similar problems with my DB controls.

The solution I used was to check the number of items selected in my deselect callback. (Use a GetDataBrowserItems() call and a GetHandleSize(items) / sizeof(DataBrowserItemID) to get the count.) I then only disable the controls if the itemcount is zero.

If it isn't zero, I know I'm in the transient state and so I ignore the notification.

Bill


_______________________________________________ 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: 
 >Data Browser selection order (From: Erik Allen <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.