NSCursor Problem
NSCursor Problem
- Subject: NSCursor Problem
- From: Marcos Tirao <email@hidden>
- Date: Fri, 27 Sep 2002 14:53:53 -0700
Hi, I'm doing a game in cocoa. But I have a little problem with
changing the image of the cursor,
Here 's a piece of code
-(id)initWithFrame:(NSRect)frameRect
{
[super initWithFrame:frameRect];
cur=[[NSCursor alloc] initWithImage:[NSImage imageNamed:@"cursor"]
hotSpot:NSMakePoint(8,8)];
....
....
}
-(void)drawRect:(NSRect)frame
{
[cur push];
}
This code work just fine. But the problem arise when I do something
like this
-(id)initHistorial:(unsigned)n
{
historia=[[NSMutableArray alloc]initWithCapacity:n];
count=0;
return self;
}
-(void)agregarAccion:(Accion)a
{
AccionObj *temp;
temp=[[AccionObj alloc]initAccionObj:a];
[historia addObject:temp];
count+=1;
}
This two function cause the Cursor becomes again in the standard arrow
and cannot change again to my desired picture without flickering.
Anyone have any idea to this problem or want to see what it happen? I
can send to anyone my game to see the problem occuring.
Another problem I detect, is that I can only play sound files, using
the NSSound class If put the [mySound play] statement in the NSView
drawRect method, this is not a requirement with Mac OS X 10.1, that
problem only happen to me with Jaguar
Any idea, what is going on?
Thank you, very much.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.