Tk Text box

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?

Message-ID: <009075d3-389d-42fc-9336-5360acc03871@g1g2000yqi.googlegroups.com>

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,

···

From: Philliam Auriemma <phil.auriemma@gmail.com>
Subject: Tk Text box
Date: Fri, 29 Jan 2010 13:45:06 +0900
----------------------------------------------------
t = TkText.new
t.bindtags -= [t.class]
----------------------------------------------------

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

----------------------------------------------------
e = TkEntry.new
e.bind('Return'){ ... callback operation ... }
----------------------------------------------------
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Thanks, that's exactly what I needed.

···

On Jan 28, 11:10 pm, Hidetoshi NAGAI <na...@ai.kyutech.ac.jp> wrote:

From: Philliam Auriemma <phil.aurie...@gmail.com>
Subject: Tk Text box
Date: Fri, 29 Jan 2010 13:45:06 +0900
Message-ID: <009075d3-389d-42fc-9336-5360acc03871@g1g2000yqi.googlegroups.com>

> 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?

----------------------------------------------------
e = TkEntry.new
e.bind('Return'){ ... callback operation ... }
----------------------------------------------------
--
Hidetoshi NAGAI (na...@ai.kyutech.ac.jp)