
January 12th, 2004, 09:14 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
Hi Nick,
The code fragment may help a bit - it copies to the clipboard selected text or if no range selected then all the text. After copying the text the highlighting is removed.
self.text is a tk multiline ScrolledText box.
Code:
if not self.text.tag_ranges(SEL):
#copy everything
self.text.tag_add(SEL,'1.0',END)
text = self.text.get(SEL_FIRST,SEL_LAST)
self.text.tag_remove(SEL,'1.0',END)
self.parent.clipboard_clear()
self.parent.clipboard_append(text)
|