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
4
votes
1 answer
Is there a way to correctly show tag borders in tkinter?
I am working on a text markup tool using tkinter. It is mostly built around using various tag methods on the Text widget. The thing that is driving me crazy, however, is my inability to get correct borders around tagged text if there are overlapping…

Dummy D.
- 41
- 3
4
votes
2 answers
Markdown Text Highlighting Performance Issues - Tkinter
Overview
I’m trying to add markdown syntax highlighting in a text editor for my project, but I am having some issues with making it user proof so to speak, while being performance friendly
Basically, I'm after this–from Visual Studio Code's…

Aardhyn Lavender
- 103
- 1
- 6
3
votes
1 answer
Why does the Text widget event <> get triggered when specifically using ?
I've come across a bug that I can't seem to understand. I have a tkinter Text widget that has a bind that triggers on text modification. For some reason this event gets triggered when I use the key combination even though it shouldn't, as it…

Blyfh
- 43
- 5
3
votes
1 answer
How to avoid changing colour of selected text in tkinter when I highlight syntax with idlelib
I have recently found out how to highlight syntax in tkinter text widget using idlelib. I've tried it and I thought it would be cool to use that to make my text editor app. But the problem is that the text which is coloured by the filter doesn't…

ss3387
- 299
- 3
- 19
3
votes
2 answers
Remove trailing space from tkinter Text widget
My goal here is to have the right edge of the text box fit to the end of the text. This happens automatically when using TkFixedFont, but when using TkDefaultFont (which is what I would like to use), there is trailing whitespace added to the end.…

camball
- 43
- 6
3
votes
2 answers
How to enter text into two text widgets by just entring into same widget
I want a method from which I can insert text into two widgets by entering text into single text widget. Simply in programming is I want to bind all functions and events of text widget to another text widget.
i had tried…

Kumar Saptam
- 336
- 5
- 18
2
votes
1 answer
Tkinter tab key not working with bindtags
I have a text field in a GUI and I'm trying to bind the tab key to an event in my class. This usually works just fine but when I try to bind it with bindtags, the tab key doesn't trigger any events. Other keypresses like return and a still…

Voltaik
- 21
- 3
2
votes
1 answer
Different focus order and stacking order tkinter
In the following example, I have created several text entries, and some can expand/collapse when you focus there.
However, when some expand (specifically, the ones named as entry_2_problem_1 and entry_5_problem_2, where I have also inserted text…

diegoperez01
- 23
- 3
2
votes
2 answers
Tkinter problem while using the text widget
I have this code to make each text "clickleable", from the Text() widget that has tkinter.
However, when I run the program and click over one text I get this error message witch each corresponding
text line:
_tkinter.TclError: bad text index "This…

juan carlos maturana
- 23
- 2
2
votes
1 answer
Is there are a Python Tkinter method in the Text widget for joining the Undo/Redo stack?
I am seeking a method that can have the functionality of joining the undo/redo stack of the Tkinter Text widget written in the Python language. Is there something like the method to merging the user input undo/redo stack programmatically, or merging…

Tkinter studio
- 37
- 4
2
votes
1 answer
Insert vertical line below tabs in tkinter.text
I am creating a code editor as my project, and I think it is nice to have vertical lines under tabs so its easier for the coder. I want to draw a vertical line below tabs (I think the image below will be better to understand what I want, Just a…

ss3387
- 299
- 3
- 19
2
votes
1 answer
How to get the text input from a tkinter text box?
I've made this converter. I want it to convert decimal values into binary and hexadecimal using Tkinter..
I made a text input box but I don't know how to get the input values from the input box.
We aren't supposed to use OOP so we can't use…

plsdontclap
- 23
- 2
2
votes
1 answer
Adaptive resizing for a tkinter Text widget
I have been attempting to create a application that contains two Text() widgets, both of which can dynamically resize when the window size is changed. Before I have always used the root.pack() manager, with fill='both' and expand=True.
While this…

ELM
- 60
- 9
2
votes
0 answers
Tkinter Change the color of a certain line in a textbox
I'm trying to change the color of a line in a textbox to a hex code without affecting the rest of the lines.
I've tried using insert tags but they change the previous lines as well. Is there a way to achieve my goal? | What I'm trying to achieve…

Itayo
- 21
- 2
2
votes
4 answers
Making a rectangle border around text in Textbox python tkinter
I want to have a rectangle border around certain text that is added to the text box from the end and will be placed at the center.
For example:
Unfortunately, I can't find a way to do that, because I
don't know how to place texts at the center of…

Chopin
- 113
- 1
- 10