Setting the width of a segment to 0 in NSSegmentedControl doesn't work so well
Setting the width of a segment to 0 in NSSegmentedControl doesn't work so well
- Subject: Setting the width of a segment to 0 in NSSegmentedControl doesn't work so well
- From: Peter Zegelin <email@hidden>
- Date: Thu, 6 Aug 2009 12:15:49 +1000
My application has a dynamic segmented control, where the user can
specify that each segment has an icon, text, or both. However I am
having trouble correctly resizing a segment.
According to the docs, calling
- (void)setWidth:(CGFloat)width forSegment:(NSInteger)segment
with 0 for the width " Specify the value 0 if you want the segment to
be sized to fit the available space automatically."
Unfortunately this only seems to work if the segment is text only. If
the segment has an icon, or an icon + text then resizing doesn't work,
as any segment with an icon doesn't include space for the icon. As a
work around I have tried setting the width to 0 and then immediately
getting the width ( with the intention of adding say 25 for the icon)
but it also returns 0.
Does anyone know what might be going on and a workaround if necessary?
Thanks!
Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden