> On 19 Nov 2015, at 06:21, Richard Frith-Macdonald > <richardfrithmacdon...@gmail.com> wrote: > > >> On 17 Nov 2015, at 17:47, Riccardo Mottola <riccardo.mott...@libero.it> >> wrote: >> >> Hi, >> >> I want to be able to theme the recycler bin icons of GWorkspace. >> >> The icons themselves are in "many places" I find the Recycler icon in three >> places: >> >> Framework: /FSNode/Resources/Images/Recycler.tiff >> GWorkspace app: /GWorkspace/Resources/Icons/Recycler.tiff >> Recycler app: Recycler/Resources/Images/Recycler.tiff >> >> The code however is done like this: >> >> NSBundle *bundle = [NSBundle bundleForClass: [FSNodeRep class]]; >> >> imagepath = [bundle pathForResource: @"Recycler" ofType: @"tiff”]; > > >> 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? > > Yes, it sounds like you can. > You use -pathForImageResource: rather than -pathForResource:ofType: > Each bundle will give you a different image (the one from the theme which > corresponds to the bundle’s identifier).
Just to be clear … the [NSBundle-pathForImageResource:] is from a category in the gui library, and is theme-aware, but the [NSBundle-pathForResource:ofType:] methoid is from the base library and not theme-aware. So a theme aware app needs to use -pathForImageResource: to load its own images, but if it does so, it should get the image the theme defines for the bundle (as determined by the bundle identifier). _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev