nscell

NSButtonCell inside custom NSCell

不羁的心 提交于 2019-11-28 18:28:35
in my cocoa application, I need a custom NSCell for an NSTableView. This NSCell subclass contains a custom NSButtonCell for handling a click (and two or three NSTextFieldCells for textual contents). You'll find a simplified example of my code below. @implementation TheCustomCell - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { // various NSTextFieldCells NSTextFieldCell *titleCell = [[NSTextFieldCell alloc] init]; .... // my custom NSButtonCell MyButtonCell *warningCell = [[MyButtonCell alloc] init]; [warningCell setTarget:self]; [warningCell setAction:@selector

Is it possible to design NSCell subclasses in Interface Builder?

可紊 提交于 2019-11-28 18:20:11
I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib. Is this possible? How do I do it? The question was about a subclass of NSCell; the other answers seem to be doing something else, likely taking advantage of UITableViewCell being a view. NSCell is not a view. While laying a custom cell out in IB would be a useful thing to be able to do, I think the answer is basically "no, this is not possible". When you subclass NSCell, you're pretty

NSButtonCell inside custom NSCell

半腔热情 提交于 2019-11-27 11:22:46
问题 in my cocoa application, I need a custom NSCell for an NSTableView. This NSCell subclass contains a custom NSButtonCell for handling a click (and two or three NSTextFieldCells for textual contents). You'll find a simplified example of my code below. @implementation TheCustomCell - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { // various NSTextFieldCells NSTextFieldCell *titleCell = [[NSTextFieldCell alloc] init]; .... // my custom NSButtonCell MyButtonCell *warningCell

Is it possible to design NSCell subclasses in Interface Builder?

守給你的承諾、 提交于 2019-11-27 11:15:42
问题 I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib. Is this possible? How do I do it? 回答1: The question was about a subclass of NSCell; the other answers seem to be doing something else, likely taking advantage of UITableViewCell being a view. NSCell is not a view. While laying a custom cell out in IB would be a useful thing to be able