Extended NSCursor to handle missing standard cursor.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20428 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-12-08 23:53:32 +00:00
parent 36aaff3b9d
commit 843814c42c
6 changed files with 28 additions and 2 deletions

View file

@ -177,11 +177,22 @@ NSCursor *getStandardCursor(NSString *name, int style)
if (cursor == nil)
{
void *c;
void *c = NULL;
cursor = [[NSCursor_class alloc] initWithImage: nil];
[GSCurrentServer() standardcursor: style : &c];
[cursor _setCid: c];
if (c == NULL)
{
/*
There is no standard cursor with this name defined in the
backend, so try an image with this name.
*/
[cursor setImage: [NSImage imageNamed: name]];
}
else
{
[cursor _setCid: c];
}
[cursorDict setObject: cursor forKey: name];
RELEASE(cursor);
}