Re: NIB Problem
Re: NIB Problem
- Subject: Re: NIB Problem
- From: Paul Schneider <email@hidden>
- Date: Fri, 2 Mar 2007 18:13:07 -0500
Hi, Christoph,
the "main" bundle will be the host application bundle, not your
plugin bundle. You can get your plugin bundle like this:
NSBundle* bundle = [NSBundle bundleForClass:[self class]];
HTH,
- Paul
On Mar 2, 2007, at 5:18 PM, Christoph Vonrhein wrote:
Hello Darrin, hello Dave, hello Apple.
I am trying to open a simple window from within a FxPlug in order
to display some data in it. I currently try it like this (in the
initWithAPIManager method):
CFBundleRef bundleRef;
IBNibRef nibRef;
OSStatus err;
bundleRef = CFBundleGetMainBundle();
err = CreateNibReferenceWithCFBundle(bundleRef,CFSTR("NibWindow"),
&nibRef);
require_noerr (err, CantGetNibRef);
err = CreateWindowFromNib(nibRef, CFSTR("Window"), &window);
require_noerr (err, CantCreateWindow);
DisposeNibReference(nibRef);
cocoaFromCarbonWin = [[NSWindow alloc] initWithWindowRef:window];
[cocoaFromCarbonWin makeKeyAndOrderFront:nil];
CantCreateWindow:
CantGetNibRef:
The Nib-file is called NibWindow.nib and it contains just a Window
object. It is placed in the English.lproj folder and in the XCode
project in the Resources folder. I also have AppKit.framework,
Foundation.framework, Cocoa.framework and Carbon.framework loaded.
The CreateNibReferenceWithCFBundle method always gives me the error
-10960 (kIBCarbonRuntimeCantFindNibFile), even though the nib file
exists.
Just for the heck of it, I once tried it with the MainMenu.nib file
from the CarbonCocoaTempConverter (http://developer.apple.com/
samplecode/CarbonCocoaTempConverter/index.html). That nib file was
loaded (no error), but the CreateWindowFromNib method failed with
error "-10", which an error number that is not even listed in
Apples doc files.
Is there something special regarding FxPlug and NIB files I did not
see so far that I have to take note off ?
best regards
Christoph Vonrhein
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >NIB Problem (From: Christoph Vonrhein <email@hidden>) |