mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-12 21:51:28 +00:00
Fix for previous fix and modified the test file.
This commit is contained in:
committed by
Ross Boucher
parent
ad0867ba7d
commit
696990f035
+3
-2
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user