Fix for previous fix and modified the test file.

This commit is contained in:
Blair Duncan
2010-10-20 18:48:29 -07:00
committed by Ross Boucher
parent ad0867ba7d
commit 696990f035
2 changed files with 16 additions and 2 deletions
+3 -2
View File
@@ -212,9 +212,10 @@ var currentCursor = nil,
- (id)initWithImage:(CPImage)image hotSpot:(CPPoint)hotSpot
{
return [self initWithCSSString:"url(" + [image filename] + ")"];
return [self initWithCSSString:"url(" + [image filename] + "), auto"];
}
- (void)mouseEntered:(CPEvent)event
{
}
@@ -228,7 +229,7 @@ var currentCursor = nil,
currentCursor = self;
#if PLATFORM(DOM)
[[self class] _setCursorCSS:_cssString + ", auto"];
[[self class] _setCursorCSS:_cssString];
#endif
}
+13
View File
@@ -37,6 +37,12 @@ var selectors = ["pointingHandCursor", "resizeDownCursor", "resizeLeftCursor", "
[button setTitle:@"set Cursor"];
[contentView addSubview:button];
var button = [[CPButton alloc] initWithFrame:CGRectMake(270,150,150,24)];
[button setAction:@selector(setUrlCursor:)];
[button setTarget:self];
[button setTitle:@"set Cursor from url"];
[contentView addSubview:button];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
@@ -49,4 +55,11 @@ var selectors = ["pointingHandCursor", "resizeDownCursor", "resizeLeftCursor", "
[cursor set];
}
-(void)setUrlCursor:(id)sender
{ // note gifs don't animate when they are used as a cursor.
var aImage = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"spinner.gif"]];
var cursor = [[CPCursor alloc] initWithImage:aImage hotSpot:CGPointMakeZero()];
[cursor set];
}
@end