The Text widget is a generalized method for displaying multiple lines of text and embedded images and windows. It also provides ways to change both the appearance and functionality of its contents — i.e. font, size, and color. You can also make the text, widgets, or embedded images respond to keyboard or mouse actions. The appearance and functional features can be controlled by associating them tags, which may be associated with multiple pieces of text.
Questions tagged [tkinter-text]
207 questions
1
vote
0 answers
Tkinter Text White Shadow on Darker Screen
There is a white shadow on my text when displayed on a darker background:
screen = tkinter.Canvas(width=145, height=650, highlightthickness=0)
screen.master.overrideredirect(True)
screen.master.lift()
screen.master.wm_attributes("-topmost",…

Simran Patel
- 11
- 1
1
vote
1 answer
Tkinter text background color does not update using .config(bg='white')
I'm writing an app that has several text input fields. The fields turn yellow when their content is modified. Saving a (changed) field resets the color to white.
I do this by binding the <> event of the text widget to a…

Georg Wille
- 11
- 1
1
vote
1 answer
Tkinter - How to update Text widget from subprocess?
I am using Tkinter to make a GUI that runs two other python scripts that I have. I wanted to print out the console to the window. I did this initially with a Label widget, and it did update and show the console as new lines were created.
Problems…

TheLegendOfLame
- 21
- 4
1
vote
1 answer
Adding Multiple Tags Tkinter Text
I am making a tkinter text editor. I'm trying to make it so that the user can press Control+b for bold text, Control+i for italic text, etc. One problem with this is overlapping tags. When I add two tags, one on top of another, like a bold tag and…

Ethan Chan
- 153
- 11
1
vote
0 answers
Displaying a Fraction in Tkinter
How can I display an editable fraction in a Tkinter Text box? Like in Word or another text editor. I'm making a function to insert equations in a Tkinter Text box.

Ethan Chan
- 153
- 11
1
vote
2 answers
How to ask user for integer input using Python tkinter
I need to ask a user for an integer value and tried a=n.get() and then a=int(a) but it doesn't work as expected. Here the code I used:
def selectparamter():
window3= Tk()
window3.title('choosing parameters ')
…

Wissam Mrd
- 11
- 3
1
vote
0 answers
Why does the font on my tkinter app look bumpy or unclear?
The font on my Debian bullseye OS normally looks just fine. However, when I create an app using tkinter and place text on it, the text looks awful. I expect my tkinter apps in general to show nice font. A screenshot of how the font appears is posted…

user13017933
- 21
- 2
1
vote
1 answer
How to find what fonts are in my module of tkinter?
How do i know what fonts are available in my tkinter? I tried the answers of others code to this question but it just won't work. Is tkinter fonts based on the installed fonts on the system or it comes preinstalled with tkinter

youngprogrammer
- 11
- 2
1
vote
1 answer
Is there a way to set a wrap length on a Tkinter Text Widget?
Question
I am trying to make a text editor in Tkinter. If a large single-line file is opened, it lags massively and stops responding. Is there a way to set a wrap length for a text widget? I have scroll bars and I don't want to have the characters…

Enderbyte09
- 409
- 1
- 5
- 11
1
vote
1 answer
Label Not Continually Updating Tkinter
I have read through several answers to similar topics but none of them are relevant to my situation, I am trying to display a list on a label and whenever the button is pressed to update the list the label should update as well but it only updates…

Reacher42
- 31
- 3
1
vote
1 answer
How to delete a character right after it was entered in Tkinter?
As stated in the title, I'm trying to delete a character right after it was entered into a text field.
import tkinter as tk
window = tk.Tk()
input = tk.Text()
input.pack()
def handle_keypress(event):
print("test")
…

mykhailohoy
- 442
- 4
- 15
1
vote
0 answers
Non-blocking print redirection to Tkinter text widget
I've been able to get print statements redirected to a Tkinter text widget based on the answer to this question. It describes a class to redirect stdout:
class TextRedirector(object):
def __init__(self, widget, tag="stdout"):
self.widget…

detroitwilly
- 811
- 3
- 16
- 30
1
vote
1 answer
updating text after running mainloop in tkinter
I want to change the text displaying in frame after my mainloop() has been called. I have created loginfo function to append text in my string but nothing happens. The GUI gets started and displays the text originally contained in it("hi"), I don't…

pain
- 17
- 8
1
vote
1 answer
How to search for whole words in a text widget?
I am Working on a Python Text Editor With Python and tkinter. But I Have Some Problems with changing font color of the text widget.
I have just started writing.
Its been just 5 mins till then.
Here is editor.py
##imports
from tkinter import…

LiftUpStack
- 58
- 4
1
vote
2 answers
How to display text on a new window Tkinter?
I've started learning Tkinter on Python few weeks ago and wanted to create a Guess Game. But unfortunately I ran into a problem, with this code the text for the rules ( in the function Rules; text='Here are the rules... ) doesn't appear on the…

Flusten
- 56
- 1
- 5