Tkinter.Text: prevent user modifications

Will Stuyvesant hwlgw at hotmail.com
Fri Aug 2 17:50:14 EDT 2002


Raimo Tuisku 
> What is the best way to prevent user from editing the contents of
> Tkinter.Text wiget but editing from the code would be possible.
> config(state) changes this, but then Tkinter.Text.insert won't work. Do I
> have to change the behavior of the widget every time I insert text or is
> there another way? Is it possible that the user can edit it when
> the state configuration is temporarily changed?-)

I am all ears too if there is another way except using config() or
Text['state']=DISABLED etc.
So I do use config(...NORMAL) when I want to change the text with code
and do config(...DISABLED) again when its over.  The user has usually
no way of changing the text then...unless they keep some button
pressed while the coded-text-change is running: then you can sometimes
see a few insertions!


'''
                        Pittsburgh driver's test
7: The car directly in front of you has a flashing right tail light
   but a steady left tail light.
        a) One of the tail lights is broken.  You should blow your
           horn to call the problem to the driver's attention.
        b) The driver is signaling a right turn.
        c) The driver is signaling a left turn.
        d) The driver is from out of town.
The correct answer is d.
Tail lights are used in some foreign countries to signal turns.
'''



More information about the Python-list mailing list