mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-22 17:51:45 +00:00
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:
parent
dd56c62969
commit
f5384ec7aa
4 changed files with 28 additions and 2 deletions
|
@ -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) */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue