0
votes

I've got a data form I developed under Snow Leopard, that has NSTextField boxes alongside NSComboBox fields, and this looked fine under Snow Leopard, but now in Lion, they're drawn slightly differently. I also have some NSComboBox fields with a bordered button, and some with an unordered button, and these don't match, either (though the bordered button NSComboBox looks close to the NSTextField, though it's not a match, either.

How can I get everything to harmoniously match? I'd be happy to get an NSTextField to autocomplete like a combo box, since I hide the button anyway.

Non-Bordered NSComboBox left, NSTextField right (different top edge):

Non-Bordered Combo vs. Text Field

Bordered NSComboBox left,NSTextField` right (different heights):

Bordered Combo vs. Text Field

1

1 Answers

2
votes

I ended up replacing my non-bordered combo boxes (for which I had been hiding the buttons) with NSTextField controls, using the method here: NSTextField AutoCompletion.

I modified it slightly:

- (void)controlTextDidChange:(NSNotification *)obj {
    if (!isAutoCompleting) {
        isAutoCompleting = YES;
        [[[obj userInfo] objectForKey:@"NSFieldEditor"] complete:nil];
        isAutoCompleting = NO;
    }
}

When I want the NSComboBox button to be visible, I use the bordered style, which matches closely enough.