From: Boo R. <boo...@wo...> - 2002-05-04 22:14:30
|
The information for wxTheClipboard->SetData say "After this function has been called, the clipboard owns the data, so do not delete the data explicitly." And sure enough, as long as the program is running, the clipboard data is accessible, but I had expected the wxTheClipboard to function like the system clipboard -- to hold a chunk of data without caring about that data's originator at all. If I manipulate the clipboard and close out a wx program, the clipboard empties itself! This is unexpected behavior, to say the least. Below is a script which illustrates this behavior. Are my expectations out of line? use strict; use Wx::DND; use Wx qw(wxTheClipboard); use Wx qw( :dnd); my $data = Wx::TextDataObject->new( "ahoyhoy" ) || print "no create data"; my $out = Wx::TextDataObject->new; if ( wxTheClipboard->Open){ wxTheClipboard->SetData( $data ) || die "no set"; wxTheClipboard->GetData ($out); print $out->GetText(); wxTheClipboard->Close; } else { print "Can't own clipboard"; } __END__ |