nssegmentedcontrol

NSTableView + NSSegmentedControl + NSSegmentSwitchTrackingSelectAny

混江龙づ霸主 提交于 2019-12-24 22:25:24
问题 I've got a table view which has an NSSegmentedCell for its right-most column. The NSSegmentedControls which the cells are pulled from are using the "any" tracking mode (aka: multiple selection) and the segments are selected based on a bitfield with possible values: 1, 2, and 4. A value of 1 means A|b|c. 2 is a|B|c. 4 is a|b|C. 3 is A|B|c, etc... That bitfield is returned by the data sources's tableView:objectValueForTableColumn:row: method and the cell is returned in the delegate's tableView

How to draw segmented control with blue tint like Xcode?

我是研究僧i 提交于 2019-11-30 15:42:26
问题 I'm trying to recreate the segmented control used in Xcode where the images are drawn with a blue tint. For example in Interface Builder: So far I have a custom NSSegmentedCell overriding - (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)controlView , but I'm stuck at how to draw the segment image (1) with the gray tint and (2) with the blue tint if it is selected. Also, it looks like the images are drawn with a bezel or gradient effect. When I draw the segment

How to draw segmented control with blue tint like Xcode?

两盒软妹~` 提交于 2019-11-30 15:15:40
I'm trying to recreate the segmented control used in Xcode where the images are drawn with a blue tint. For example in Interface Builder: So far I have a custom NSSegmentedCell overriding - (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)controlView , but I'm stuck at how to draw the segment image (1) with the gray tint and (2) with the blue tint if it is selected. Also, it looks like the images are drawn with a bezel or gradient effect. When I draw the segment image myself it is simply black (because I use template images). How can I recreate the segment from