--- rxvt-unicode/src/perl/macosx-clipboard 2006/12/07 20:59:59 1.1 +++ rxvt-unicode/src/perl/macosx-clipboard 2007/11/12 14:41:42 1.2 @@ -37,6 +37,20 @@ 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) = @_; @@ -59,25 +73,6 @@ () } -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) = @_;