NSComboBoxCell menu problems in Leopard
NSComboBoxCell menu problems in Leopard
- Subject: NSComboBoxCell menu problems in Leopard
- From: glenn andreas <email@hidden>
- Date: Wed, 14 Nov 2007 10:42:23 -0600
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:
This email sent to email@hidden