Re: [Camelbones-devel] Pref Panes?
Brought to you by:
shermpendley
From: Jay L. <ja...@in...> - 2003-06-29 13:40:51
|
On Saturday, June 28, 2003, at 09:49 AM, Jay Lawrence wrote: > Has anybody written a preferences pane using Camelbones? > > If so, would you be willing to share the source to help me get going? > I got part of the way there - I needed to create a new method to load Perl code to execute.... currently looks in application bundle for 'main.pl' or similar. for v0.3 I'd add to AppMain.m extern int CBApplicationMain3(const char *wrapperFolder, const char *scriptName, int argc, const char *argv[]) { NSAutoreleasePool *arPool = [[NSAutoreleasePool alloc] init]; CBPerl *sp = [CBPerl sharedPerl]; NSString *perlFolder = [NSString stringWithFormat: @"%s/Contents/Resources", wrapperFolder]; [sp useLib: [NSString stringWithFormat: @"%s/Contents/Resources", wrapperFolder]]; NSString *mainPL = [NSString stringWithFormat: @"%@/%s", perlFolder, scriptName]; NSString *perlcode = [NSString stringWithContentsOfFile: mainPL]; // Run Perl startup code [sp eval: perlcode]; // Clean up [arPool release]; return 0; } This way I can specify the Bundle path for my local pref pane instead of the bundle for the System Preferences application. Now I have to figure out how to add myself as a delegate to the opened preferences window ... J |