Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Tk::Clipboard and the X Windows Clipboard

by kwoff (Friar)
on Oct 29, 2001 at 21:26 UTC ( [id://121942]=note: print w/replies, xml ) Need Help??


in reply to Tk::Clipboard and the X Windows Clipboard

WARNING: I've never used Tk from Perl before.

FWIW, I just experimented a bit with it, and I get the error you're talking about in xclipboard. But then I tried:

my $mw = MainWindow->new(); $mw->clipboardClear(); $mw->clipboardAppend('clip'); my $selected = $mw->SelectionGet(); MainLoop;

i.e., I followed it with SelectionGet() and MainLoop, and it printed 'clip' into the xclipboard window.

.... erm, but now I'm getting an error:

PRIMARY selection doesn't exist or form "STRING" not defined at ./tk.p +l line 9

Man, that's really flakey.

Replies are listed 'Best First'.
(bbfu) (other error) Re2: Tk::Clipboard and the X Windows Clipboard
by bbfu (Curate) on Oct 30, 2001 at 02:33 UTC

    The reason it works for you is because of the MainLoop, not the SelectionGet(). I stumbled on the fact that MainLoop makes it work just as you were posting. :-) Now I just need to apply traveler's DoOneEvent suggestion...

    The other error you are getting is because no other application owns the selection when you try to get it.

    Thanks for your help. :-)

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://121942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-19 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found