Python Forum
[Tkinter] Text widget inert mode on and off - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [Tkinter] Text widget inert mode on and off (/thread-33352.html)



Text widget inert mode on and off - rfresh737 - Apr-18-2021

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


RE: Text widget inert mode on and off - joe_momma - Apr-18-2021

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')



RE: Text widget inert mode on and off - Yoriz - Apr-18-2021

WxPython has a StyledTextCtrl that can be set to overtype mode
https://docs.wxpython.org/wx.stc.StyledTextCtrl.html#wx.stc.StyledTextCtrl.EditToggleOvertype Wrote:EditToggleOvertype(self)
  • Switch from insert to overtype mode or the reverse.



RE: Text widget inert mode on and off - rfresh737 - Apr-18-2021

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


Text widget: insert and overwrite modes? - rfresh737 - Apr-19-2021

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


RE: Text widget inert mode on and off - joe_momma - Apr-19-2021

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.