Hi, On Sun, 24 May 2009 10:30:03 +0200 "Michael O'Donnell" <michael.odonn...@uam.es> wrote:
> Hi O.C. > > The following code shows how to use an Entry widget > which ignores all key presses except Control-c and Control-x > (copy and cut at least under windows). > > from Tkinter import * > > def copy1(event): > pass > > def printKey(event): > return "break" > > main=Tk() > > wt=Entry(main, bg="white") > wt.insert(END, "FRed") > wt.pack(side=LEFT, fill=BOTH,expand=True) > wt.bind("<Control-c>", copy1) > wt.bind("<Control-x>", copy1) > wt.bind("<KeyPress>", printKey) > main.mainloop() > > The copy-enabled label should be much easier to implement: >>> from Tkinter import * >>> root = Tk() >>> e=Entry(root,relief='flat',bd=0,takefocus=0,highlightthickness=0) >>> e.pack() >>> e.insert('end', 'foobar') >>> e.config(state='readonly') Regards Michael _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss