Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have to create a new <em>Loadable Bundle</em> target that contains your nibs and your Cocoa code. Add the bundle product to the <em>Copy Bundle Resources</em> phase of your plugin. Then the code for a filter plugin that loads a Cocoa window with some controls would be:</p> <pre><code>Boolean DoUI (void) { // Create the CF Cocoa bundle CFBundleRef pluginBundle; CFURLRef cocoaBundleURL; pluginBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.example.plugin")); cocoaBundleURL = CFBundleCopyResourceURL(pluginBundle, CFSTR("Cocoa_bundle"), CFSTR("bundle"), NULL); CFBundleRef cocoaBundleRef; cocoaBundleRef = CFBundleCreate(kCFAllocatorDefault, cocoaBundleURL); CFRelease(cocoaBundleURL); // start Cocoa (for CS3) NSApplicationLoad(); NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; // load the cocoa bundle by identifier NSBundle* cocoaBundle; cocoaBundle = [NSBundle bundleWithIdentifier:@"com.example.plugin.cocoa"]; // load the window controller from the bundle Class testControllerClass; testControllerClass = [cocoaBundle classNamed:@"MyWindowController"]; MyWindowController* winController = [[testControllerClass alloc] init]; [NSApp runModalForWindow:[winController window]]; [[winController window] performClose:nil]; [winController release]; // release the bundle CFRelease(cocoaBundleRef); [pool release]; return 1; } </code></pre> <p>This is based on the Craig Hockenberry <a href="http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/" rel="nofollow noreferrer">bundle trick</a>. I'm still testing it but it should work both on CS3 and CS4.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload