Python Forum

Full Version: Text widget inert mode on and off
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't find anything that talks about how to set a text widget insert mode on and off? My text widget is always in insert mode. I assume I can set it to an overwrite mode as well?

UPDATE:

Here are two screen shots of what I'd like my cursors to look like.

Insert Mode

Overwrite Mode

Thank you...
the Text widget inherits from Widget,XView and YView.
as far cursors you need to change them manually.

>>> from tkinter import *
>>> root= Tk()
>>> t= Text(root)
>>> t.pack()
>>> t.config(state='disabled')
WxPython has a StyledTextCtrl that can be set to overtype mode
https://docs.wxpython.org/wx.stc.StyledT...leOvertype Wrote:EditToggleOvertype(self)
  • Switch from insert to overtype mode or the reverse.
>as far cursors you need to change them manually

Are you referring to text.config(cursor="dot blue") or something else?

>t.config(state='disabled')

I don't want to make my text widget read-only.
From what I can read online about the Text widget, it doesn't support the concept of having insert and overwrite modes correct? If I wanted to have those features, I'd have to code that up myself? Or have I just missed that in the Text widget docs?

Thank you...
Quote:From what I can read online about the Text widget, it doesn't support the concept of having insert and overwrite modes correct? If I wanted to have those features, I'd have to code that up myself? Or have I just missed that in the Text widget docs?
1 nope. 2 Yes write it yourself. 3. nope or use another gui that has it.