On Sat, 2013-04-13 at 13:23 +0100, Ru Vuott wrote:
> Thank you Fabien,
> 
> but if I want to use "clipboard.Paste()" Gambas function, after simply 
> highlighted an external text, it doesn't work.
> It works, if I highlight the (external) text and I use ctrl+C function or 
> "Copy" function from right button of mouse.
> 
> I repeat: if I highlight an external text and after simply I use 
> "clipboard.Paste()", my Gambas application doesn't get and doesn't show that 
> text.
> 

(Just to clarify something about your actual problem. If your user
highlights text in some external window and then clicks the middle mouse
button over a gambas textarea, does the text appear?  If not then there
is something wrong somewhere else, not in your gambas program.)


You cannot get the highlighted text in gambas because the highlighted
text is not in the desktop clipboard, it is only in the
X-"clipboard"-buffer.  qt4.clipboard only knows about the desktop
clipboard.

The solution will lie in getting the highlighted text into the desktop
clipboard. There used to be some command line programs "xsel" and
"xclip" that copied the X-buffer into the active desktop clipboard, but
these seem to have disappeared and I know not what they were replaced
by.

So, if for example, you have a button you want to use to initiate the
paste then 

        Public Sub btnPasteXClip_Click()
        
          Dim sXClip as String
        
          Exec ["Whatever_has_replaced_xclip","etc"]
          sXClip=Clipboard.Paste
        
        End

should work.

cheers
Bruce


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to