Fixes from jgapen

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6355 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-03-22 21:39:00 +00:00
parent dd56c62969
commit f5384ec7aa
4 changed files with 28 additions and 2 deletions

View file

@ -44,6 +44,25 @@ void __dummy_IMLoading_functionForLinking()
return [GMModel loadIMFile:path owner:owner bundle:self];
}
+ (BOOL)loadGModelNamed:(NSString *)gmodelName owner:(id)owner
{
NSBundle *bundle;
NSString *path;
/* Pull off the .gmodel extension (if any) for pathForResource:ofType: */
if ([[gmodelName pathExtension] isEqualToString:@"gmodel"])
gmodelName = [gmodelName stringByDeletingPathExtension];
/* Use owner's bundle (if any) just like +loadNibNamed:owner: does. */
bundle = [NSBundle bundleForClass: owner];
if (bundle == nil)
bundle = [NSBundle mainBundle];
path = [bundle pathForResource:gmodelName ofType:@"gmodel"];
return [GMModel loadIMFile:path owner:owner bundle:bundle];
}
@end /* NSBundle(IMLoading) */