site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Hi, Christoph, 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. CFBundleRef bundleRef; IBNibRef nibRef; OSStatus err; err = CreateWindowFromNib(nibRef, CFSTR("Window"), &window); require_noerr (err, CantCreateWindow); DisposeNibReference(nibRef); cocoaFromCarbonWin = [[NSWindow alloc] initWithWindowRef:window]; [cocoaFromCarbonWin makeKeyAndOrderFront:nil]; CantCreateWindow: CantGetNibRef: best regards Christoph Vonrhein _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... the "main" bundle will be the host application bundle, not your plugin bundle. You can get your plugin bundle like this: 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): bundleRef = CFBundleGetMainBundle(); err = CreateNibReferenceWithCFBundle(bundleRef,CFSTR("NibWindow"), &nibRef); require_noerr (err, 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 ? _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/pschneider% 40apple.com This email sent to pschneider@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Paul Schneider