Re: Icon in window title
Re: Icon in window title
- Subject: Re: Icon in window title
- From: Tom Waters <email@hidden>
- Date: Sat, 26 May 2001 12:44:20 -0700
I found that one right after I sent the mail, of course...
but I still can't find a way to get an NSImage into an IconRef, so I'm
trying to get a standard icon via GetIconRef().
I searched and searched for a standard icon which is the "computer
icon", but couldn't find it, so i'm testing with the Apple logo.
IconRef iconRef;
OSErr err = GetIconRef(kOnSystemDisk, kSystemIconsCreator,
kAppleLogoIcon, &iconRef);
OSStatus status = SetWindowProxyIcon([window windowRef], iconRef);
NSLog(@"x %d %d", iconRef, err, status);
It looks like I'm getting the Apple Logo okay, because err is 0, and
iconRef is 0x1000008b, but status is always -5600 and the icon never
shows up.
Any ideas?
On Saturday, May 26, 2001, at 12:37 PM, Andreas Monitzer wrote:
On Saturday, May 26, 2001, at 09:18 , Tom Waters wrote:
I found this in MacWindows.h
extern OSStatus SetWindowProxyIcon(WindowRef window, IconRef icon);
It might solve my problem if I knew how to convert an NSWindow to a
WindowRef and an NSImage to an IconRef.
Anybody know how to do this?
From NSWindow.h:
@interface NSWindow(NSCarbonExtensions)
// create an NSWindow for a Carbon window - windowRef must be a Carbon
WindowRef - see MacWindows.h
- (NSWindow *)initWithWindowRef:(void * /* WindowRef */)windowRef;
// return the Carbon WindowRef passed into initWithWindowRef: - see
MacWindows.h
- (void * /* WindowRef */)windowRef;
@end
andy
--
Discussion forthcoming.