-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cross-platform clipboard support on Tableview #115
Comments
Adding for reference: https://bugs.python.org/issue40452 |
Besides the option to copy the selection to the clipboard. An option to copy the selection with the header would be interesting, it would be the same code above, but the variable 'str_all_columns' would start with the value of the headers. |
@antrrax this should be expanded to all widgets if possible. Preferably without adding dependencies, but if not possible, then we can look at using the pyperclip solution referenced. It looks like the root of this may be the tkinter bug referenced above. @PySimpleGUI, were you able to find a solution for this for PSG? |
https://wiki.archlinux.org/title/Clipboard Interesting read. The behavior on Linux actually makes sense with respect to this protocol as the data is not actual copied until pasted, which is why it probably gets lost in tkinter. |
@antrrax, pyperclip relies on xclip and xsel which would have to be installed on Linux in many cases unless you are using a full featured distro such as Ubuntu or Linux Cinnamon, etc... I'm assuming that pyperclip handles these missing packages in some way? Perhaps an error message? I'll put this on the development list as something to review. |
On Ubuntu/mint need to install xclip and xsel. But as it is something that is used frequently, it is already in my system post installation script, so I forget that it doesn't come with the vanilla system. |
Add option to copy selection to clipboard.
A code example (maybe there are other better ways), I don't know what it's like on Windows and Mac. But on Linux you need to use pyperclip to keep the data on the clipboard after closing the program. And on linux you also need to do this 'update()' twice and need the
return 'break'
example:
Originally posted by @antrrax in #114 (comment)
The text was updated successfully, but these errors were encountered: