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

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

    Glenn Andreas                      <gandreas...>
      <http://www.gandreas.com/> wicked fun!
    quadrium | prime : build, mutate, evolve, animate : the next
    generation of fractal art
previous month november 2007 next month
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today