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
  [Tkinter] The Text in the Label widget Tkinter cuts off the Long text in the view malmustafa 4 4,664 Jun-26-2022, 06:26 PM
Last Post: menator01
  Scaling text QLabel following display mode windows '100%, 125% ...) VIGNEAUD 2 2,217 Jul-07-2021, 06:38 PM
Last Post: deanhystad
  Line numbers in Text widget rfresh737 3 5,308 Apr-15-2021, 12:30 PM
Last Post: rfresh737
  tkinter text widget word wrap position chrisdb 6 7,442 Mar-18-2021, 03:55 PM
Last Post: chrisdb
  [Tkinter] Get the last entry in my text widget Pedroski55 3 6,294 Jul-13-2020, 10:34 PM
Last Post: Pedroski55
  How to place global tk text widget in class or on canvas puje 1 2,281 Jul-04-2020, 09:25 AM
Last Post: deanhystad
  [Tkinter] manipulation of string in Text widget Stauricus 2 2,974 Feb-17-2020, 09:23 PM
Last Post: Stauricus
  [Tkinter] Paste Operation not working in Text Widget Code_Enthusiast 1 2,906 Sep-11-2019, 08:49 PM
Last Post: Larz60+
  [Tkinter] adapt management grid mode to management pack mode atlass218 4 3,050 Apr-24-2019, 11:04 AM
Last Post: atlass218
  how to insert image into Text widget Tkinter atlass218 5 9,924 Apr-17-2019, 05:28 AM
Last Post: atlass218

Forum Jump:

User Panel Messages

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