[Gambas-user] How to read mouse wheel string

Bruce bbruen at ...2308...
Sat Apr 13 22:16:56 CEST 2013


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





More information about the User mailing list