EditorGadget() clears the clipboard when the program ends
Posted: Mon May 05, 2025 1:39 pm
Hello
For me the clipboard is always deleted when the program ends if the program has an EditorGadget().
I haven't found anything about it here.
Here is a test program:
1. Start the test program
2. Copy the text to the clipboard using Control+C
3. Start Notepad
4. Paste the text into Notepad using Control+V (works)
5. Close the test program
6. Paste the text into Notepad again using Control+V (nothing)
It occurs in the IDE and in the EXE.
Can anybody confirm this ?
My configuration:
PB-Version: PureBasic 6.21 Beta 7 (Windows - x64)
OS: Windows 8.1 64 Bit
Greetings
Ralf
For me the clipboard is always deleted when the program ends if the program has an EditorGadget().
I haven't found anything about it here.
Here is a test program:
Code: Select all
OpenWindow(0, 0, 0, 500, 100, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(1, 10, 10, 480, 80) ; does not keep the text in the clipboard
;StringGadget(1, 10, 10, 480, 80, "") ; keeps the text in the clipboard
SetGadgetText(1, "blabla")
Repeat
Until WaitWindowEvent(20) = #PB_Event_CloseWindow
Define xxx$ = GetClipboardText()
;SetClipboardText(xxx$) ; This is the solution to keep the text in the clipboard after the program ends.
Debug GetClipboardText() ; The text is still in the clipboard.
End
2. Copy the text to the clipboard using Control+C
3. Start Notepad
4. Paste the text into Notepad using Control+V (works)
5. Close the test program
6. Paste the text into Notepad again using Control+V (nothing)
It occurs in the IDE and in the EXE.
Can anybody confirm this ?
My configuration:
PB-Version: PureBasic 6.21 Beta 7 (Windows - x64)
OS: Windows 8.1 64 Bit
Greetings
Ralf