Re: contentSizeForFrameSize and frameSizeForContentSize for NSTabView and NSWindow?
Re: contentSizeForFrameSize and frameSizeForContentSize for NSTabView and NSWindow?
- Subject: Re: contentSizeForFrameSize and frameSizeForContentSize for NSTabView and NSWindow?
- From: Brian Webster <email@hidden>
- Date: Thu, 6 Nov 2003 17:22:16 -0600
NSWindow has these methods:
+ (NSRect)frameRectForContentRect:(NSRect)cRect styleMask:(unsigned
int)aStyle;
+ (NSRect)contentRectForFrameRect:(NSRect)fRect styleMask:(unsigned
int)aStyle;
The tricky part is that they are class methods instead of instance
methods, so you need to pass in the style mask of the window you want
to know the rect for. Also, Apple did just add more convenient
instance methods for this, but they are only available in Panther.
- (NSRect)frameRectForContentRect:(NSRect)contentRect;
- (NSRect)contentRectForFrameRect:(NSRect)frameRect;
The closest I can find for NSTabView is the contentRect method, which
will give you the current size of the content rect of the tab view, but
there doesn't seem to be anything into which you can pass in an
arbitrary rectangle for transformation.
On Nov 6, 2003, at 4:27 PM, email@hidden wrote:
Hello,
I am sorely feeling the lack of the convenience methods
contentSizeForFrameSize
frameSizeForContentSize
for both NSTabView and NSWindow.
NSScrollView has them, and they are very useful.
Currently, I am using a crude hack of estimating the number of pixels
for the
borders of both NSTabView and NSWindow. Is there a more elegant
workaround?
Thanks,
Ujwal
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.