Add cross-platform clipboard support on Tableview
See original GitHub issueAdd 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:
import pyperclip
def tvw_item_ckick(self, event=None):
self.tvw.selection()
str_all_columns = ''
for n in self.tvw.selection():
str_columns = '\t'.join(self.tvw.item(n, 'values'))
str_all_columns += f'''{str_columns}\n'''
self.clipboard_clear()
self.update()
try:
pyperclip.copy(str_all_columns)
except TclError as e:
raise e
self.update()
return 'break'
self.tvw.bind('<Control-c>', self.tvw_item_ckick)
self.tvw.bind('<Control-C>', self.tvw_item_ckick)
_Originally posted by @antrrax in https://github.com/israel-dryer/ttkbootstrap/issues/114#issuecomment-1004099982_
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
copy data from tableview to clipboard | B4X Programming Forum
Looking for recommendation on how to copy data from tableview w/wo headers ... B4X is a set of simple and powerful cross platform...
Read more >Clipboard - .NET MAUI | Microsoft Learn
This article describes how you can use the .NET Multi-platform App UI (.NET MAUI) IClipboard interface. With this interface, you can copy and ......
Read more >Copy entire grid control / table view content to clipboard with ...
Copy entire grid control / table view content to clipboard with table header context menu function · Answers approved by DevExpress Support.
Read more >Titanium SDK 10.0.0.GA - 17 May 2021
Use the cross-platform Ti.UI.Toolbar instead. Ti.UI.TabGroup#getActiveTab(), Use the Ti.UI.TabGroup.activeTab property instead ...
Read more >Qt model view and cut copy paste - Srivats P
Note: Most of Ostinato's views (that support copy-paste) are ... I created a singleton ClipboardHelper class, added the actions as private ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding for reference: https://bugs.python.org/issue40452
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.