RE: Width of NSSegmentedControl[SOLVED]
RE: Width of NSSegmentedControl[SOLVED]
- Subject: RE: Width of NSSegmentedControl[SOLVED]
- From: "Peter Karlsson" <email@hidden>
- Date: Fri, 17 Sep 2004 10:45:58 +0000
Here is the solution:
After I have added a new segment to the NSSegmentedControI I use this code:
[mySegmentedControl sizeToFit];
After that I can read the width, as simple as that.
Peter
From: "Peter Karlsson" <email@hidden>
To: email@hidden
Subject: Width of NSSegmentedControl
Date: Fri, 17 Sep 2004 07:52:51 +0000
Dear list!
I have a NSSegmentedControl that the user add segments to with a button. I
need to know the width of the segmented control but... I can't use this
code:
targetRect = [mySegmentedControl frame];
float width = targetRect.size.width;
This will only give me the width of the control, not the width of all
segments together. It seems that the width of the control has nothing to do
with the width of all segments added together. Must I use a loop and add
individual segment width's together to get the final width?
Best regards Peter
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden