开发者

NSButton Inside NSTextField

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.

NSButton Inside NSTextField


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜