• 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: NSCursor Resize Cursor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCursor Resize Cursor


  • Subject: Re: NSCursor Resize Cursor
  • From: Joachim <email@hidden>
  • Date: Fri, 27 Jan 2006 00:03:53 -0800

It's getting late...

In my previous post, change
- void NSCursor *MyCursor (int cursor)
to
+ (NSCursor *)cursor:(int)cursor

and
NSCursor *nwseCursor = MyCursor (kNESWCursor);
to
NSCursor *nwseCursor = [YourClass myCursor:kNESWCursor];

The code should look like this (haven't tested it):

+ (NSCursor *)cursor:(NSString *)cursorFile withHotSpot:(NSPoint)hotSpot
{
    // Returns the cursor using the given image
    // Caller must retain it

    NSCursor  *cursor;
    NSImage   *cursorImage;

cursorImage = [[NSImage alloc] initWithContentsOfFile:
[[NSBundle bundleWithIdentifier:kCSPaneBundleIdentifier]
pathForResource:cursorFile ofType:nil]];
cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:hotSpot];


    [cursorImage release];
    [cursor autorelease];
    return cursor;
}

+ (NSCursor *)cursor:(int)cursor
{
    // Return the desired cursor
    switch (cursor) {
        case kNESWCursor:
            return [YourClass cursor:@"Angle45ResizeCursor.tiff"
                         withHotSpot:NSMakePoint (8, 8)];
    ...
}

NSCursor *nwseCursor = [YourClass cursor:kNESWCursor];
[neswCursor push];
...
[[NSCursor currentCursor] pop];

Joachim
_______________________________________________
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


  • Prev by Date: Re: NSCursor Resize Cursor
  • Next by Date: Re: Bindings or datasource for a large NSTableView
  • Previous by thread: Re: NSCursor Resize Cursor
  • Next by thread: Re: NSCursor Resize Cursor
  • Index(es):
    • Date
    • Thread