I want to realize "Cut" in Rightkey menu by the following code:
self.entry_title = entry(frm, RIGHT, self.title, width = 58)
def menubarCut(self):
if not self.entry_title.selection_present():
showerror('***', 'No text selected')
else:
text = self.entry_title.selection_get()
self.entry_title.selection_clear()
self.clipboard_clear()
self.clipboard_append(text)
However, menubarCut returns the effect of "Copy" instead of "Cut". Namely, the results returned by the above code is the same as that returned by the following code:
self.entry_title = entry(frm, RIGHT, self.title, width = 58)
def menubarCopy(self):
if not self.entry_title.selection_present():
showerror('***', 'No text selected')
else:
text = self.entry_title.selection_get()
self.clipboard_clear()
self.clipboard_append(text)
It seems that self.entry_title.selection_clear()
has no effect. Why does that happen? How can I solve this problem?