[Done] SetClipboardText

Post bugreports for the Linux version here
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

[Done] SetClipboardText

Post by #NULL »

Code: Select all

SetClipboardText("abc123")
Doesn't seem to work here.
PureBasic 6.21 Beta 4 (Linux - x64)
Ubuntu 24.04.2 LTS

I run this code, then open a new tab in the IDE and repeatedly press ctrl+v. Nothing is pasted the first couple of times and after a while what is pasted is what was in the clipboard before I ran the code, but never what SetClipboardText() was supposed to put there. Not sure if the KDE Plasma clipboard manager is messing with it. Can anybody reproduce this? The clipboard docs don't state what library is used.
Last edited by #NULL on Sun May 25, 2025 9:54 am, edited 1 time in total.
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: SetClipboardText

Post by #NULL »

If i run xclipboard first and then run the code, then xclipboard as well as KDE clipboard manager shows the correct string.
User avatar
mk-soft
Always Here
Always Here
Posts: 6224
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: SetClipboardText

Post by mk-soft »

With Mint Linux LMDE 6 the clipboard works with the short code.

I have tested it with Ubuntu 22.04 and 24.04
The application must run here

Code: Select all

If OpenWindow(0, 0, 0, 300, 160, "Test")
  SetClipboardText("Hello")
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Break
    EndSelect
  ForEver
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: SetClipboardText

Post by #NULL »

That works here too. But if i kill or close the app, the clipboard is still set correctly. PB probably uses gtk functions for clipboard, so maybe event processing is necessary to make it work. If that's the case, the clipboard library doc should mention that.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] SetClipboardText

Post by Fred »

Fixed.
Post Reply