Re: NSCursor Resize Cursor
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