bug-gnustep
[Top][All Lists]
Advanced

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

Re: Fix, GMAppKit - Image loading


From: Fred Kiefer
Subject: Re: Fix, GMAppKit - Image loading
Date: Sat, 12 Nov 2005 16:38:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921

Hi Georg,

Georg Fleischmann wrote:
>
>> could you just explain shortly why this patch is needed and also why
>> this is not a general problem of the way [NSImage imageNamed:] is
>> implemented? We are using imageNamed: for the GORM encoding as well, so
>> if this is a general problem it should be fixed for this as well.
> 
> Yes this may be a general problem with GORM files as well.
> 
> I think [NSImage imageNamed:] is ok. It searches inside the main bundle only. 
>  
> This seems to be correct, because the OpenStep method doesn't know images  
> located in other bundles as well (I wouldn't even know how the image class  
> could be aware of other bundles than the main bundle. Could it?).
> 

You are correct, [NSImage imageNamed:] should according to the
specification only look in the main Bundle. So Gorm and later NIB
loading will face the same problem as GModel. When loading an image from
a NIB (gorm, gmodel) file from a different bundle, the image names will
be looked up in the main bundle. Your code is a nice workaround for the
GModel loading, but wont help in the other cases.

> So my impression is that the loading of bundle images is special and in the  
> responsibility of the interface loading (in this case). The interface loading 
>  
> provides the file owner ([NSBundle loadNibNamed: owner:]) which is giving the 
>  
> hint to the bundle. I'm not aware of any other way to load these images.

Does anybody have a nice and clean idea to work around this?
Should we have something like a current bundle, which gets set in the
NIB (Gmodel, Gorm) loading code and will be used, if resources wont be
found in the main bundle?





reply via email to

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