Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Perl on OSX > Re: Proposed Ma...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 21 Topic 1034 of 1075
Post > Topic >>

Re: Proposed Mac::Pasteboard

by harryfmudd@[EMAIL PROTECTED] Jan 27, 2008 at 10:53 AM

On Jan 27, 10:49 am, chas.ow...@[EMAIL PROTECTED]
 (Chas. Owens) wrote:
> On Jan 26, 2008 10:46 PM,  <harryfm...@[EMAIL PROTECTED]
> wrote:
>
> > On Jan 22, 2:31 am, brian.d....@[EMAIL PROTECTED]
 (Brian D Foy) wrote:
> > > [[ This message was both posted and mailed: see
> > >    the "To," "Cc," and "Newsgroups" headers for details. ]]
>
> > > In article
> > >
<012120080315.17779.47940E4B0005B0340000457322007507440B0B9A0300979D9D0E
>
> > > 0...@[EMAIL PROTECTED]
>, <harryfm...@[EMAIL PROTECTED]
> wrote:
> > > > Is there a module that will let one manipulate a Mac OS X
pasteboard? There
> > > > does not seem to be anything on CPAN that strikes me as being for
that
> > > > purpose.
>
> > > I'd like to have such a thing, although you should call it
> > > Mac::Clipboard :)
>
> > I dithered about this. The arguments as I see them are:
>
> > For Mac::Clipboard
>
> > 1) That's what most people call the thing.
>
> > For Mac::Pasteboard
>
> > 1) It's what the Apple do***entation calls it.
>
> > 2) There's a lot more to it than (e.g.) Win32::Clipboard. For one
> > thing, there's more than one of them -- in fact, as many as you like.
> > Each can have multiple data items, with data in multiple flavors.
>
> snip
>
> Why choose?  Write Mac::Pasteboard with all of the bells and whistles
> and then write Mac::Clipboard using Mac::Pasteboard to expose only the
> clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
> and people who need the advanced functionality can find it.

Interesting thought. The straightforward implementation would be to
have Mac::Clipboard depend on Mac::Pasteboard (since there's no
simplified clipboard interface that I have found). But it seems un-
parsimonious to me to use namespace for maybe a dozen lines of Perl,
since right now the "clipboard" part is on the order of

my %pb_cache;

sub pbcopy {
    my $pb = $pb_cache{kPasteboardClipboard} ||= __PACKAGE__->new
(kPasteboardClipboard);
    $pb->copy (@[EMAIL PROTECTED]
);
}

sub pbpaste {
    my $pb = $pb_cache{kPasteboardClipboard} ||= __PACKAGE__->new
(kPasteboardClipboard);
    $pb->paste (@[EMAIL PROTECTED]
);
}

But thanks for the suggestion.

Tom Wyant
 




 21 Posts in Topic:
Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-21 03:15:23 
Re: Proposed Mac::Pasteboard
claes@[EMAIL PROTECTED]   2008-01-21 15:04:21 
Re: Proposed Mac::Pasteboard
brian.d.foy@[EMAIL PROTEC  2008-01-22 01:31:33 
Re: Proposed Mac::Pasteboard
douglist@[EMAIL PROTECTED  2008-01-25 22:45:31 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-26 18:06:16 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-26 19:46:30 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-26 20:05:29 
Re: Proposed Mac::Pasteboard
chas.owens@[EMAIL PROTECT  2008-01-27 10:49:58 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-27 10:53:31 
Re: Proposed Mac::Pasteboard
bva@[EMAIL PROTECTED] (B  2008-01-27 18:11:07 
Re: Proposed Mac::Pasteboard
brian.d.foy@[EMAIL PROTEC  2008-01-28 08:32:03 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-27 19:03:54 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-28 10:45:56 
Re: Proposed Mac::Pasteboard
david@[EMAIL PROTECTED]   2008-01-29 15:49:48 
Re: Proposed Mac::Pasteboard
chas.owens@[EMAIL PROTECT  2008-01-28 20:32:32 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-30 10:01:04 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-01-31 18:55:33 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-02-05 09:38:05 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-02-05 19:10:47 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-02-14 09:19:41 
Re: Proposed Mac::Pasteboard
harryfmudd@[EMAIL PROTECT  2008-02-18 07:53:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 3:24:29 CDT 2008.