Tkinter Text

Rony rony.steelandt at bucodi.com
Fri Feb 1 05:55:05 EST 2002


jmsun at bioeng.ucsd.edu (Jeffrey) wrote in message news:<3daa1aa8.0201311053.6dd349bf at posting.google.com>...
> Hi Everyone,
>   I have a question about the Tkinter Text Widget.  I want to make it
> so that I disable the user's ability to write text.  I know that it is
> possible to do this by doing: text_widget.configure( state =
> 'disabled' ).  But when I do this I also lose the ability to scroll
> up/down/left/right/pageUP/pageDown.  I don't want the user to lose the
> ability to use the keyboard as a scroll method.  Does anyone know how
> to solve this off the top of their head?

Here's a quick solution

1. Record a state flag in self.state couldbe enable and disable
2. In the press key or release key event of the widget test self.state
If it is disable refuse caracters



> 			
> 						Thanks,
> 							Jeff



More information about the Python-list mailing list