I'm trying to increase the height of a NSSegmentedControl, beyond the 25px "Regular" control size. I subclassed NSSegmentedCell, I understand that i have 2 methods to work with.
- (void)drawSegment:(NSInteger)segment
inFrame:(NSRect)frame
withView:(NSView *)controlView
- (void)drawWithFrame:(NSRect)frame
inView:(NSView *)view
If I place a segmented control in IB then override the above methods in my NSSegmentedCell subclass. As excepted the frame and view that are passed in are based on the height of the segmented control in IB. So, Im not sure where to go from here.
Do I have to subclass NSSegmentedControl as well and draw my own control at my required height? and then use the NSSegmentedCell subclass to handle the segments?
The default NSSegmentedControl
does not allow you to adjust its drawn height. To do this, you will have to subclass it (and NSSegmentedCell
) and override its drawing functions with your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With