• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView drawing over super problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTextView drawing over super problem
      • From: Antonio Nunes <email@hidden>
  • Prev by Date: Re: How to properly add a document with -addDocument
  • Next by Date: Re: NSTextView drawing over super problem
  • Previous by thread: Getting VSIZE-RSIZE from process id
  • Next by thread: Re: NSTextView drawing over super problem
  • Index(es):
    • Date
    • Thread