…in thirteen easy steps or your money back.
This release is only compatible with Tiger (10.4).Please see kineme.net for Leopard-specific informations.
-
Start up Interface Builder:
-
Make a new NIB, with a “Cocoa / Empty” starting point:
-
Make a subclass of
NSObjectcalledQCInspector. Then make a subclass ofQCInspectorwith the class name of your patch, followed by “UI”.P5GloveUIin this case:
-
Drag a “CustomView” into the project:
-
Select “File’s Owner” and set its “Custom Class” to the UI subclass you created above (
P5GloveUIin this case):
-
Control-drag from “File’s Owner” to “View”, then “Connect” the view to the UI subclass’s “view” outlet:
-
Throw a few controls onto the View if you’d like:
-
Save the NIB in your patch’s English.lproj folder, and add it to the project:
-
Add the QCInspector interface to your patch’s
qcplugin.h:@interface QCInspector : NSObject { NSView *view; QCPatch *_patch; void *_unused2[4]; } + (id)viewNibName; + (id)viewTitle; - (id)init; - (void)didLoadNib; - (id)patch; - (void)setupViewForPatch:(id)fp8; - (void)resetView; - (id)view; @end -
Add
inspectorClassWithIdentifierto your patch’s interface:P5Glove.h:
@interface P5Glove : QCPatch ... + (Class)inspectorClassWithIdentifier:(id)fp8; @end
-
Implement
inspectorClassWithIdentifier:P5Glove.m:
@implementation P5Glove : QCPatch ... + (Class)inspectorClassWithIdentifier:(id)fp8 { return [P5GloveUI class]; } @end -
Add the
P5GloveUIclass interface and implementation to your patch’s project:P5GloveUI.h:
@interface P5GloveUI : QCInspector + (id)viewNibName; // IMP=0x97b89415 @end
P5GloveUI.m:
@implementation P5GloveUI : QCInspector + (id)viewNibName { return @\"P5GloveUI\"; } -
Build and launch Quartz Composer. You’ve got an inspector:
- Enjoy.
[…] In addition to writing the Inspector panels for custom Quartz Composer patches tutorial, I spent this weekend writing up some advanced custom-patch-development documentation and posted it on QC Wiki: […]
By fdiv.net » Advanced custom Quartz Composer patch development documentation on 05.13.07 12:04 | Permalink
[…] Quartz Composer tidbits: Steve Morkis over at fdiv has been doing some very interesting work writing custom patches, so far providing an xcode template, custom inspector how-to, and an apple remote patch, amongst others. I’m interested in seeing a cli patch that would send commands to the terminal and run external scripts. Very exciting, though the QC community is a little unsure about what this means in the face of Leopard. […]
By New Media Initiatives Blog » WebWalker 1.6 on 05.18.07 11:03 | Permalink
This was a great tutorial… a couple of small details that probably wouldn’t take anybody to long to figure out but are worth mentioning (unless I’m wrong about them).
1. I believe you need to link to the UI header file from within your patches .h file, since the inspectorClassWithIdentifier method returns the UI class.
2. You need to link to the qcplugin.h file inside your UI Header file, so that the UI class knows what a QCInspector is.
Thanks again for this tutorial, and for your excellent template.
By charlie on 06.11.07 04:20 | Permalink