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: Riccardo Mottola
Subject: Re: Theming non-main-app images
Date: Wed, 18 Nov 2015 15:44:50 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39

Fred Kiefer wrote:
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.

Right, that is cleaner! I'll fix that. However it doe snot change the basics here: the "path" is the Framework path and not the current running application path. This way it is not themable.

If using imageNamed, shouldn't the App resources be used, and thus be themable? In that case I'd need to provide the icons in all apps that use this icon, in our case GWorkspace and Recycler (and the theme should override both). Not very clean, but bearable..


When using imageNamed: you should leave out the extension.

Actually, the Apple doc says that it works both way, but it would be convention to use the extension if a file name is given (like here) and no extension if it is the name for a constant.

Does it make any sense?

Having an extension is acutally cumbersome for theming, because you need to override in the theme the image with the asme extension as the app. (not only a TIFF instead of a PNG, but even TIFF vs TIF)

Riccardo



reply via email to

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