Mailing Lists: Apple Mailing Lists

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

NSComboBoxCell menu problems in Leopard



I've got a view (a subclass of NSControl) that contains a number of cells, including text fields, sliders, checkboxes, popup buttons and combo boxes. In Panther, everything works fine, but under Leopard, the item list that pops up in a combo box isn't anchored to the cell frame, but is at the very bottom left corner of the screen (making it all but impossible to use).

The code, boiled down, is:

[selectedCell setObjectValue:value];
[selectedCell calcDrawInfo: frame];
[selectedCell highlight:YES withFrame:frame inView:self];
NSRect textFrame = [cell titleRectForBounds: frame];
if ([selectedCell isEditable] && NSPointInRect(where, textFrame)) {
// do text editing
} else if ([selectedCell trackMouse:[[self window] currentEvent] inRect:frame ofView:self untilMouseUp:YES]) {
// get and change the value
}
[selectedCell highlight:NO withFrame:frame inView:self];



The text editing part works fine (in both the combo boxes and text fields - not surprising, since the former is a subclass of the latter), and trackMouse: routine works fine for everything except the combo box cell . I've double checked that "frame" is correct, as is the current event - I tried code that stored the event in mouseDown which eventually calls this code just in case the event was somehow changed.


A plain NSComboBox control works fine, it's just the NSComboBoxCell usage that is a problem....


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next generation of fractal art




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to 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.