NSTextView drawing over super problem
NSTextView drawing over super problem
- Subject: NSTextView drawing over super problem
- From: "John Cassington" <email@hidden>
- Date: Mon, 10 Jul 2006 13:50:54 +1000
Hi everyone,
I have created an NSTextView subclass, which currently gives itself a 1
pixel gray border. I would like to overlay an image of a circle to show page
numbers, but it must be over the text. This (i presume) means that i have to
call [super drawRect...] before i draw the image. I have tried this but it
is still not working
Here is my sample code...
-(void)drawRect:(NSRect)rect {
NSRect wholeRect = [self bounds];
NSRect textRect = NSInsetRect(wholeRect,1,1);
[[NSColor grayColor] set]; // or grayColor if that's what you want
NSFrameRect(wholeRect);
NSImage *circleImage = [NSImage imageNamed:@"Circle"];
[super drawRect:textRect];
[circleImage drawAtPoint:NSMakePoint(0,0) fromRect:wholeRect
operation:NSCompositeSourceOver fraction:1.0];
}
Any help is greatly appreciated, because i have no idea what I'm doing
wrong.
Thanks,
John Cassington
_______________________________________________
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