our($appkit, $pasteboard);
+$appkit = NSBundle->alloc->init->initWithPath_('/System/Library/Frameworks/AppKit.framework');
+$appkit->load if $appkit;
+
+if ($appkit->isLoaded) {
+ no strict 'refs';
+ for my $class (qw(NSPasteboard)) {
+ @{$class . '::ISA'} = 'PerlObjCBridge';
+ }
+} else {
+ undef $appkit;
+}
+
+$pasteboard = NSPasteboard->generalPasteboard;
+
sub copy {
my ($self) = @_;
()
}
-sub on_start {
- my ($self) = @_;
-
- $appkit = NSBundle->alloc->init->initWithPath_('/System/Library/Frameworks/AppKit.framework');
- $appkit->load if $appkit;
-
- if ($appkit->isLoaded) {
- no strict 'refs';
- for my $class (qw(NSPasteboard)) {
- @{$class . '::ISA'} = 'PerlObjCBridge';
- }
- } else {
- undef $appkit;
- }
-
- $pasteboard = NSPasteboard->generalPasteboard;
- ()
-}
-
sub on_user_command {
my ($self, $cmd) = @_;