Python Forum
[Tkinter] Text widget inert mode on and off
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Text widget inert mode on and off
#1
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...
Reply
#2
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')
Reply
#3
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.
Reply
#4
>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.
Reply
#5
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...
Reply
#6
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Scaling text QLabel following display mode windows '100%, 125% ...) VIGNEAUD 2 359 Jul-07-2021, 06:38 PM
Last Post: deanhystad
  Line numbers in Text widget rfresh737 3 814 Apr-15-2021, 12:30 PM
Last Post: rfresh737
  tkinter text widget word wrap position chrisdb 6 2,126 Mar-18-2021, 03:55 PM
Last Post: chrisdb
  [Tkinter] Get the last entry in my text widget Pedroski55 3 2,015 Jul-13-2020, 10:34 PM
Last Post: Pedroski55
  How to place global tk text widget in class or on canvas puje 1 833 Jul-04-2020, 09:25 AM
Last Post: deanhystad
  [Tkinter] manipulation of string in Text widget Stauricus 2 1,374 Feb-17-2020, 09:23 PM
Last Post: Stauricus
  [Tkinter] Paste Operation not working in Text Widget Code_Enthusiast 1 1,538 Sep-11-2019, 08:49 PM
Last Post: Larz60+
  [Tkinter] adapt management grid mode to management pack mode atlass218 4 1,550 Apr-24-2019, 11:04 AM
Last Post: atlass218
  how to insert image into Text widget Tkinter atlass218 5 6,430 Apr-17-2019, 05:28 AM
Last Post: atlass218
  [Tkinter] Lock Text Widget height Oxylium 3 2,112 Feb-14-2019, 10:13 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020