tkinter text

richard_chamberlain at my-deja.com richard_chamberlain at my-deja.com
Wed Jul 19 03:33:39 EDT 2000


Keith,

There may be a better way of doing it...

from Tkinter import *
root=Tk()
text=Text(root,width=50,height=50)
text.pack()
def intercept(event):
    return 'break'
text.bind('<Key>',intercept)
text.insert(END,'Sweet ;-)')
root.mainloop()

Here I bind a <Key> event to the intercept function - where I
return 'break' to stop the event propagating, so basically it's
disabled. To undisable you'd just need to unbind that event.

Richard


In article <8l1pfa$oci$1 at nnrp1.deja.com>,
  Keith Murphy <kpmurphy at my-deja.com> wrote:
> is there a way to make a text box uneditable by the user, but
insertable
> ( insert(END, 'schweet') ) by the application?  thanks
>
> -->keith
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list