Tk Text box

P

Philliam Auriemma

Is there any way I can create a text box in Tk that the user cannot
edit, but the program can edit the value of? I have tried doing state
('disabled') on a TkText but this makes it not editable at all.

Also, is there a way I can bind an event to someone hitting enter in a
TkEntry?
 
H

Hidetoshi NAGAI

From: Philliam Auriemma <[email protected]>
Subject: Tk Text box
Date: Fri, 29 Jan 2010 13:45:06 +0900
Message-ID: said:
Is there any way I can create a text box in Tk that the user cannot
edit, but the program can edit the value of? I have tried doing state
('disabled') on a TkText but this makes it not editable at all.

Remove its classs from the bindtags of the widget.
Probably, it is the most simple way.
For example,
 
P

Philliam Auriemma

From: Philliam Auriemma <[email protected]>
Subject: Tk Text box
Date: Fri, 29 Jan 2010 13:45:06 +0900
Message-ID: said:
Is there any way I can create a text box in Tk that the user cannot
edit, but the program can edit the value of? I have tried doing state
('disabled') on a TkText but this makes it not editable at all.

Remove its classs from the bindtags of the widget.
Probably, it is the most simple way.
For example,
----------------------------------------------------
t = TkText.new
t.bindtags -= [t.class]
----------------------------------------------------
Also, is there a way I can bind an event to someone hitting enter in a
TkEntry?

Thanks, that's exactly what I needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top