Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def copyBuf(self, event):
- import win32clipboard
- import win32con
- copydata = event.widget.get(SEL_FIRST, SEL_LAST)
- win32clipboard.OpenClipboard()
- win32clipboard.EmptyClipboard
- textClip = win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, copydata)
- win32clipboard.CloseClipboard()
- print (copydata)
- def pasteBuf(event):
- import win32clipboard
- import win32con
- win32clipboard.OpenClipboard()
- textClip = win32clipboard.GetClipboardData()
- win32clipboard.CloseClipboard()
- def menuWidgets(self, event):
- menu = Menu(self, tearoff=0)
- menu.add_command(label='вставить', command=self.pasteBuf)
- menu.add_command(label='копировать', command=self.copyBuf(self)
- menu.add_command(label='вырезать', command=root.quit)
- menu.post(event.x_root, event.y_root)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement