[Gambas-user] clipboard paste doesn't work
Charlie Reinl
Karl.Reinl at ...9...
Mon Sep 28 20:44:03 CEST 2009
Am Montag, den 28.09.2009, 18:55 +0200 schrieb Charlie Reinl:
> Am Montag, den 28.09.2009, 16:00 +0200 schrieb Stefano Palmeri:
> > Il lunedì 28 settembre 2009 09:48:31 Charlie Reinl ha scritto:
> > > Am Samstag, den 26.09.2009, 21:55 +0200 schrieb Benoît Minisini:
> > > > > Hi, Benoit.
> > > > >
> > > > > It seems that Clipboard.Paste() doesn't work (see example pasteclip).
> > > > >
> > > > > I select a text somewhere, then press in the example "Paste from
> > > > > clipboard", but it does not return the text I've selected. To make it
> > > > > work I have to:
> > > > >
> > > > > 1) select the text;
> > > > > 2) copy the text;
> > > > > 3) press the button "Paste from clipboard"
> > > >
> > > > There are two clipboards on X-window. One that is filled when you select
> > > > something, and the other that is filled when you explicitely select the
> > > > "copy" command.
> > > >
> > > > In Gambas, the Clipboard class only deals with the second clipboard, not
> > > > the first one.
> > > >
> > > > Regards,
> > >
> > > Salut,
> > > is there a way to inspect the first clipboard ?
> >
> > I tried different solution, because I need this option in one application.
> > I don't want users install xsel:
> >
> > http://www.vergenet.net/~conrad/software/xsel/#intro
> >
> > So looking around I found a python script that does the job and
> > can be easily distributed within a gambas project:
> > Here's the code for using once. Best way is copying the script
> > on startup somewhere.
> >
> >
> > PUBLIC SUB Main()
> >
> > DIM sClipboardPrimary, sPythonScript AS String
> > sPythonScript = Temp$
> >
> > File.Save(sPythonSCript, "import gtk\nclip =
> > gtk.clipboard_get(selection='PRIMARY')\nprint clip.wait_for_text()")
> >
> > SHELL "python " & sPythonSCript TO sClipboardPrimary
> > PRINT sClipboardPrimary
> >
> > END
>
> Salut Stefano,
>
> I just want to know where my Ctrl+C ends, so I thinks that will do it.
>
> You will have news about. Thank you very much!
>
Hi all,
made a small project on base of Stefano's script, in an expanded
version, now I can say CTRL+C and Context-Copy is not the same for me
on gambas2.17
Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copy_and paste_test.tar.gz
Type: application/x-compressed-tar
Size: 8028 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090928/df862f40/attachment.bin>
More information about the User
mailing list