I'm trying to create a NSTextField with a button on its right side (similar to a NSSearchView), but I can't figure out how to have the NSTextField's text scroll without going under the NSButton.
Here is my code thus far:
rightButton = [[NSButton alloc] initWithFrame:rect];
[rightButton setTarget:self];
[[rightButton cell] setHighlightsBy:NSNullCellType];
[rightButt开发者_运维技巧on setImage:[NSImage imageNamed:@"rightButton"]];
[rightButton setAction:@selector(action:)];
[rightButton setBordered:NO];
Any thoughts?
EDIT: Here is a screenshot of the problem.
I think this is what you're looking for. Basically what you're doing is adjusting the frame to compensate for the button you put inside the field.
精彩评论