• 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
Re: Subviews use superview's `drawRect' method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subviews use superview's `drawRect' method?


  • Subject: Re: Subviews use superview's `drawRect' method?
  • From: Damien Sorresso <email@hidden>
  • Date: Tue, 16 Aug 2005 11:03:09 -0500

On 16 Aug, 2005, at 10:35 AM, Fritz Anderson wrote:
More to the point: Does the box drawRect: stroke the framing rectangle based on the NSRect passed to it? So that when the button region is dirty it frames the button?

Here's the code for the `drawRect' method.

- (void)drawRect:(NSRect)rect {
    NSBezierPath *fill = [NSBezierPath bezierPathWithRect:rect];

    [[NSColor colorWithCalibratedRed:1.0f
                               green:1.0f
                                blue:1.0f
                               alpha:0.5f] set];

    [fill fill];

    [[NSColor grayColor] set];

    [fill setLineWidth:1.5f];
    [fill stroke];
}

Should I be stroking `bounds' and not `rect'?
--
Damien Sorresso
Macintosh Developer
Computer Infrastructure Support Services
Illinois State University
email@hidden
309.438.5777

_______________________________________________
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: Subviews use superview's `drawRect' method?
      • From: Jim Correia <email@hidden>
References: 
 >Subviews use superview's `drawRect' method? (From: Damien Sorresso <email@hidden>)
 >Re: Subviews use superview's `drawRect' method? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Subviews use superview's `drawRect' method?
  • Next by Date: Re: Subviews use superview's `drawRect' method?
  • Previous by thread: Re: Subviews use superview's `drawRect' method?
  • Next by thread: Re: Subviews use superview's `drawRect' method?
  • Index(es):
    • Date
    • Thread