Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

16.13. Clipboard Methods

The following methods manipulate the internal Tk clipboard and also the Windows clipboard (either Unix or Win32).

To add data to the clipboard, use the clipboardAppend method:

$widget->clipboardAppend("data to add");

When you call clipboardAppend, you can specify a format by using the -formatoption with a value. The -format by default is "STRING", but it can also be "ATOM". Another option can be specified, -type, which takes a string such as "STRING" or "FILE_NAME".

To clear out the clipboard, use clipboardClear:

$widget->clipboardClear();

Any data in the clipboard will be removed.

To find out what is in the clipboard, see the selectionGet method in the section entitled "Getting the Selection."

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata