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
votes
1 answer
tkinter: How to start a new line after opening parenthesis?
I have a program with my code, the idea is: I have a textbox, I put a text in it and with I button I need to create a new line after any open parenthesis. I have little experience with tkinter and I don't even know where to start to do this, I also…

Marco Tomasi
- 82
- 5
-1
votes
1 answer
Tkinter button doesnt work in class method
I'm trying to create some kind of C# terminal and methods using Tkinter in Python. Everything works fine but now I'm unable to create buttons using a method. It throws an error: _tkinter.TclError: unknown option "-commmand". If I create a button…

Uchiha Obito
- 19
- 4
-1
votes
1 answer
how to set value in Text widget in tkinter?
My problem: I can't display the value to Text widget when I select a row.
how can I display a value inside the Text widget from the selected row?
I tried using textvariable attribute in Text widget but its not working.

Renzm.6958
- 33
- 6
-1
votes
1 answer
How to get cursor position details in tkinter Textbox
I made a text editor in it I made an status bar but a problem I did not know how to get cursor position details like notepad
Please help me

Naitik Singhal
- 126
- 1
- 4
-1
votes
2 answers
How do i read all the links present in a file using open function in Python?
imagelist=[]
with open("imagelink.txt") as url:
for url2 in url:
if url2.strip():
raw_data= urllib.request.urlopen(url2.strip()).read()
im = ImageTk.PhotoImage(data=raw_data)
result =…

Anime Nerdy
- 5
- 4
-1
votes
1 answer
my output is showing the tkinter widget error and button error and not displaying the button
the following was my code for creating to do list application
from tkinter import ...
// i have just not mentioned all imports
root = Tk()
root.title("My Todo List App")
root.configure(background="light green")
root.geometry("550x500") …

Kurdush
- 1
- 1
-1
votes
2 answers
Replacing the tkinter.Text insert method
I was trying to replace (at runtime) the inherited insert() method for a subclass of tkinter.Text. The replacement method executes a few lines of code before calling the parent class' (tkinter.Text) insert() method. However, at runtime python shows…

Sam
- 23
- 2
-1
votes
2 answers
How Do I Replace A Word With Another one In tkinter.Text
I am actually trying to make a python coding editor, for that I need to make a color-coding system. For example: 'def', 'or', 'if', 'elif', 'else', 'import' etc. should be in different colors as they are commands. Something like this:
from tkinter…

Ultra
- 21
- 2
-1
votes
2 answers
How to auto indent next line of string
I am trying to make a program using Python that will auto indent the next line of string when it encounters certain characters such as braces.
For example:
public class Example{
--indent--> public static void main (String[]args){
--indent-->…

Amber
- 13
- 7
-1
votes
1 answer
How to fix '_tkinter.TclError: nothing to undo' error
I am just trying to make a notepad using python Tkinter. when I tried to code for the undo and redo command I got error.
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
class TextEditor:
current_file =…

Divyanshu Gupta
- 103
- 6
-2
votes
1 answer
I want to create an png format image in Tkinter text widget
I want to create an png format image in Tkinter text widget. when I run my code, it works but just show a white image. what can I do about that?
elif int(w4_toc1.selection()[0]) == 21:
w4_tex_title.insert('end',…

khayyam didar
- 1
- 3
-3
votes
2 answers
when generating text the text displays how can I display the generated thing properly in tkinter python?
from ctypes.wintypes import SIZE
from tkinter import * # import tkinter
import secrets
window = Tk() # creates window
window.title('PassGen') # changes title
window.geometry('600x400') # sets size
window.resizable(False,False) # prevents user from…

rnsleep
- 3
- 3