All pastes #148191 Raw Edit

ryguy4377

public python v1 · immutable
#148191 ·published 2006-08-24 23:01 UTC
rendered paste body
class CtCpPst(Text):    def __init__(self, master, **kw):        Text.__init__(self, master, **kw)        self.bind('<Control-c>', self.copy)        self.bind('<Control-x>', self.cut)        self.bind('<Control-v>', self.paste)            def copy(self, event=None):        self.clipboard_clear()        text = self.get("sel.first", "sel.last")        self.clipboard_append(text)        def cut(self, event):        self.copy()        self.delete("sel.first", "sel.last")    def paste(self, event):        text = self.selection_get(selection='CLIPBOARD')        self.insert('insert', text)