• 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: penPat equivalent in cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: penPat equivalent in cocoa?


  • Subject: Re: penPat equivalent in cocoa?
  • From: Brendan Younger <email@hidden>
  • Date: Wed, 12 Sep 2001 16:56:13 -0400

On Wednesday, September 12, 2001, at 09:39 AM, gordon davis wrote:

> hi,
>
> 1. What is the equivalent to penPat command in cocoa.
>
Now, please note I am not a CoreGraphics junky, so the best I can offer
is something like this:
void CGContextSetLineDash(CGContextRef ctx, float phase,
const float lengths[], size_t count);
This can be found on page 32 (or 29 if you go by the numbers in the
lower left/right hand corners) of the Drawing With Quartz 2D pdf. If my
understanding is correct, you can fill a rect with this pattern.
Now, that's the low-level version, if you're working with AppKit
objects, you can use NSColor. You can create a pattern of any sort that
you wish from an image, or you can use some of the handy-dandy already
defined ones which are listed in the docs. Simply use -[NSColor set] to
set the current color to draw with.

> 2. I want to set cursor such as when to zoom,selection of frame How I
> can
> achieve it?.
>
NSView manages tracking rectangles. You should read the "Tracking
Rectangles and Cursor Rectangles" portion of the NSView documentation to
get a handle on exactly how it all works.
The NSCursor docs are fairly straight forward, to see if you're doing
right, you could try:
NSCursor* myIBeam;
myIBeam = [NSCursor IBeamCursor];
[aView addCursorRect:[aView frame] cursor:myIBeam];
[myIBeam setOnMouseEntered:YES];

If your view normally has an arrow cursor over it, this will tell you
immediately whether you're doing it right.
>
> Thanks.

Brendan Younger


  • Prev by Date: Re: Cocoa Open GL help
  • Next by Date: Re: GNU configure script breaking
  • Previous by thread: Re: Can I use more than one controller in same application
  • Next by thread: Re: penPat equivalent in cocoa?
  • Index(es):
    • Date
    • Thread