gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Theming non-main-app images


From: Fred Kiefer
Subject: Re: Theming non-main-app images
Date: Tue, 17 Nov 2015 22:15:18 +0100

Am 17.11.2015 um 18:47 schrieb Riccardo Mottola <address@hidden>:
> NSBundle *bundle = [NSBundle bundleForClass: [FSNodeRep class]];
> 
> imagepath = [bundle pathForResource: @"Recycler" ofType: @"tiff"];
> trashIcon = [[NSImage alloc] initWithContentsOfFile: imagepath];

You should be using pathForImageResource: here.

> I think this code is done so that the Framework's Resource, indepdendently if 
> it is called from inside GWorkspace or Recycler.
> 
> Can I "theme" a Framework by specifying a bundle idnentifier?
> 
> Nevertheless, having duplication, I tried to "theme" this quick way:
> trashIcon = [[NSImage imageNamed:@"Recycler.tiff"] retain];

When using imageNamed: you should leave out the extension.

Hope this helps,
Fred


reply via email to

[Prev in Thread] Current Thread [Next in Thread]