Hi all,
I spent most of the day trying to implement a Cocoa service with
Camelbones.
It would be great if someone could point me to some sample code or
documentation.
I have included a report on my progress below.
Also, is there a list of open sourced Camelbones programs (which would
make great material for studying) ?
After some search on Google I only found the examples included in
Camelbones and JournalX
(http://rubberband.org/code/JournalX_v0.1.1.dmg.gz).
Thanks,
Thilo
======= Here is what I did (and what did not work) ========
a) set up the service description in Info.plist as described in the
Cocoa Developer Docs
This step worked, as I could see my service in the Services menu.
Also, when I clicked on it, it would launch my application.
b) register the service provider
in MyApp.pm
sub applicationWillFinishLaunching {
my ($self, $notification) = @_;
# Create the new controller object
$wc = new MyWindowController;
# register System Services
NSApplication->sharedApplication->setServicesProvider($wc);
return 1;
}
This step apparently also worked, because without it I got a message
about not being able to find a provider for the selector.
c) implement the service
in MyWindowController.pm
$OBJC_EXPORT{'evaluateService:userData:error:'} = {
'method' => 'evaluateService_userData_error',
'args' => '@@@',
};
sub evaluateService_userData_error{
my ($self, $pboard, $userdata, $error) = @_;
die "$self $pboard $userdata $error\n";
}
( this method just dies with some debug output, so I can see it
actually got invoked).
I think this method never gets called.
My program gets started when I choose the service.
I see the spinning beachball for a while, but there are no error
messages.
The program keeps running.
I am not sure how I can get more debugging output.
