tkinter-text

Tkinter – How to resize frame containing a text widget (in all directions)?

Tkinter – How to resize frame containing a text widget (in all directions)? Question: I’m trying to resize certain layered tkinter components, mostly because I’m curious. Right now, seems stuck in trying to resize a frame containing a text widget. here is my attempt: import tkinter as tk def make_draggable(widget): widget.bind("<Button-1>", on_drag_start) widget.bind("<B1-Motion>", on_drag_motion) widget.bind("<Button-3>", …

Total answers: 1

Tkinter insert function inserts text on to the same line all the time even when I change the line I input

Tkinter insert function inserts text on to the same line all the time even when I change the line I input Question: scoreboard = tkinter.Text(window) scoreboard["state"] = "normal" scoreboard.pack() for count, name, score in zip(range(len(names)), names, scores): scoreboard.insert(str(float(count+1)), f"{count+1}. {name} {score}/10") scoreboard["state"] = "disabled" For example: If names = ["user2", "user1"] and scores = [3,0] …

Total answers: 1

Python Tkinter text insert from another module

Python Tkinter text insert from another module Question: I’m using python for my little project and for fun I made my program one single file and it’s kinda large and messy right now so I decide try to devide several files and import it. It’s ok to work but the problem is I have no …

Total answers: 1

Insert vertical line below tabs in tkinter.text

Insert vertical line below tabs in tkinter.text Question: 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 …

Total answers: 1

binding Label in tkinter while function runs

binding Label in tkinter while function runs Question: I have a code where by clicking button, function runs. But inside function there are two labels that I want them to appear with text inside labels while python runs from top to bottom inside function. As it displays in cmd if they were print() statements, whenever …

Total answers: 1

when generating text the text displays <function s at 0x000001B240AB3E2> how can I display the generated thing properly in tkinter python?

when generating text the text displays <function s at 0x000001B240AB3E2> how can I display the generated thing properly in tkinter python? Question: from ctypes.wintypes import SIZE from tkinter import * # import tkinter import secrets window = Tk() # creates window window.title(‘PassGen’) # changes title window.geometry(‘600×400’) # sets size window.resizable(False,False) # prevents user from changing …

Total answers: 2

Making a rectangle border around text in Textbox python tkinter

Making a rectangle border around text in Textbox python tkinter Question: 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 …

Total answers: 4

How to set the justification of the text to "Justify" in tkinter?

How to set the justification of the text to "Justify" in tkinter? Question: I am trying to justify the text from tkinter text. The other answers (How to set justification on Tkinter Text box)said that it is my answer. I am try to use this code (I am using tkinter 8.6 and Python 3): import …

Total answers: 2