Perl/Tk clipboard question

Posted on 2004-11-09
Last Modified: 2008-01-09
Hi there,

I have a Perl/Tk application that I've written that has a few scrolling Text box widgets for user entry. The whole application works fine, and copying/cutting and pasting operations between the various text boxes works exactly as it should while the application is running. However, when the application closes, the data on the clipboard is lost. So, for example, if I type some stuff in a box and copy it, I could paste it immediately into notepad. However, if I close the application and then try to paste, the clipboard is empty.

Is there any way to preserve the clipboard data after the application is closed? I doubt that this matters, but I am working on Windows XP (and I am mainly concerned with this application working on Windows machines).

I am using activestate perl v5.008004 for MSWin32 (win32 build 810) and Tk v. 804.027

Thanks in advance for any help!
Question by:nicholassolutions
    LVL 2

    Accepted Solution

    I didn't know the TK clipboard would do that but if your useing XP try to use the Win32 Clipboard:
    LVL 15

    Author Comment

    Hey thanks for the idea, I had not thought of that -- I'll give that a try.
    LVL 15

    Author Comment

    Thanks for the workaround -- I think perl/tk may actually be able to do this on it's own, but I tried Win32::Clipboard and it worked great -- a lot easier than figuring it out in ptk.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    Perl help 10 225
    read PayflowPro reports using the report metadata using perl 11 24
    Perl 101 11 63
    Add additional column to .csv using Perl. 8 102
    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now