Copy paste in entry widget
VK
"myname" at example.invalid
Sat May 28 19:09:41 EDT 2005
Skip Montanaro wrote:
> Michael> is copy, paste, cut of selection possible in entry widget? Docs
> Michael> say selection must be copied by default, in my programm it
> Michael> doesn't work.
>
> What platform? What GUI toolkit?
>
Linux, Windows. TkInter, Pmw.
I've already implemented this with code under my message, but "cut"
copies entrytext, without deleting selection. Any ideas
def copy(self):
global copied
if self.entry.selection_present():
self.entry.clipboard_clear()
copied = self.entry.selection_get()
self.entry.bell()
def paste(self):
self.entry.insert(END, copied)
def cut(self):
global copied
self.entry.clipboard_clear()
if self.entry.selection_present():
copied = self.entry.selection_get()
self.entry.selection_clear()
self.entry.bell
More information about the Python-list
mailing list