How to read and write selected text to clipboard? (Copy Paste)
For example in the Editor gadget?
Copy Paste gadget editor
Re: Copy Paste gadget editor
Code: Select all
SetGadgetText(#MyEditor,GetClipboardText())
SetClipboardText(GetGadgetText(#MyEditor))Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
-
andrey2023
- New User

- Posts: 7
- Joined: Mon Mar 06, 2023 5:55 am
Re: Copy Paste gadget editor
need highlighted text
Re: Copy Paste gadget editor
Sorry, I overhead the "selected".
Windows:
Typed on my phone, hope it's correct.
Windows:
Code: Select all
Define start.l.end.l
Sendmessage_(GadgetID(#MyEditor),#EM_GETSEL,@start,@end)
SetClipboardText(Mid(GetGadgetText(#MyEditor),start+1,end-start))Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
-
andrey2023
- New User

- Posts: 7
- Joined: Mon Mar 06, 2023 5:55 am
Re: Copy Paste gadget editor
and under linux?
Re: Copy Paste gadget editor
Under Linux you need a different approach.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Copy Paste gadget editor
It is always an advantage to specify in your initial question for which operating system you are looking for a solution.
Here is a sample code for Linux:
http://www.chabba.de/Linux/EditorGadget ... Command.pb
- Select text in the EditorGadget and press the left button at the top to copy the selected text to the clipboard.
- Select text in the EditorGadget and press the middle button at the top to cut out the selected text and copy it to the clipboard.
- Place the text cursor anywhere in the text of the EditorGadget and press the top right button to paste the text from the clipboard to the position of the text cursor.

Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version

