Re: Some NSSplitView questions
Re: Some NSSplitView questions
- Subject: Re: Some NSSplitView questions
- From: Marco Scheurer <email@hidden>
- Date: Mon, 10 Jun 2002 17:37:34 +0200
On Monday, June 10, 2002, at 02:07 pm, Cristian Savu wrote:
Q1. Can somebody tell me what is the difference between those two
NSSplitView types available in IB ?
I sow that if I'm using the one with "3 lines" some strange
invalidation
occurs.
I've checked the archives and I couldn't found any information.
It looks like a bug to me, but the working type is fine.
Q2. The horizontal splitter contains a small rectangle with 2 or 3
lines
in it. The vertical splitter is empty and is very difficult to notice.
Is
there any way to make the vertical splitter to look like the horizontal
one
withought subclassing ?
I don't think so. Here is code for a subclass that fixes the problem.
Can be used with a poseAs.
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
------------------------------------------------------------
#define THUMB_HEIGHT 20.0
#define THUMB_WIDTH 3.0
#define LINE_WIDTH 2.0
@implementation FixedSplitView
- (void) fixThumbInRect:(NSRect) aRect
{
NSRect thumbRect = NSMakeRect (
NSMinX(aRect) + (NSWidth(aRect) - THUMB_WIDTH) / 2.0,
NSMinY(aRect) + (NSHeight(aRect) - THUMB_HEIGHT) / 2.0,
THUMB_WIDTH,
THUMB_HEIGHT);
NSBezierPath *thumb = [NSBezierPath bezierPath];
[thumb setLineWidth: LINE_WIDTH];
[thumb moveToPoint:NSMakePoint (NSMinX(thumbRect), NSMinY(thumbRect))];
[thumb lineToPoint:NSMakePoint (NSMinX(thumbRect), NSMaxY(thumbRect))];
[thumb moveToPoint:NSMakePoint (NSMaxX(thumbRect), NSMinY(thumbRect))];
[thumb lineToPoint:NSMakePoint (NSMaxX(thumbRect), NSMaxY(thumbRect))];
[[NSColor lightGrayColor] set];
[thumb stroke];
}
- (void) drawDividerInRect:(NSRect)aRect
{
[super drawDividerInRect:aRect];
if ([self isVertical]) {
[self fixThumbInRect:aRect];
}
}
@end
_______________________________________________
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.