2,043 questions
0
votes
1
answer
60
views
Tkinter grid propagation and scrolling
I have a tkinter window that runs script, with this general layout:
┌─────────────────────────────────────┐
│ Op Buttons │ ← Row 0 (fixed)
├───────────────────────────────────...
0
votes
1
answer
83
views
Getting canvas.find_closest(x, y) to discriminate among elements
I have problems getting canvas.find_closest(x, y) to work properly.
Below you can see a minimum working example. The program draws several points in the map (small radius ovals) and several horizontal ...
-1
votes
1
answer
62
views
Using move method from canvas on object created from another class
I created a class called Player in a player.py file. The class creates a rectangle when called and I am trying to use canvas.move using the created object in my main.py file. So I created object as ...
1
vote
3
answers
170
views
How can I run a long-running task in Tkinter without freezing the UI (while keeping real-time updates on a Canvas)?
I’m building a Tkinter app where I visualize sorting algorithms on a Canvas.
The problem: whenever I run the sorting function, the entire UI freezes until the function finishes.
Here’s a simplified ...
-1
votes
1
answer
167
views
How can I make a backgroud grid using tkinter to help align items?
I am trying to make a grid system for my tkinter window. I do not know how to do this correctly. This would be a system where I can enter something like 2,2 and it puts it on the grid (with larger ...
1
vote
1
answer
79
views
How do you remove the background of a Checkbutton in tkinter?
I'm trying to overlay Checkbuttons on an Image in tkinter, so that the user can select locations on the image.
Unfortunately, the Checkbuttons always have a grey background which I have not been able ...
1
vote
1
answer
74
views
Tkinter Canvas postscript outputing black rectangles instead of child widget
I am working on Tkinter (Python3.12) on Windows 10.
My issue is that when using postscript on a Canvas on which a window was drawn, only black rectangles appear instead.
After some tests, the ...
-4
votes
1
answer
81
views
Spacing between widgets in tkinter
I wanted the button and password input to be right next to each other without a gap, but I ran into this problem and there was a gap between them. I tried to remove the space between this input and ...
0
votes
2
answers
113
views
The tkinter canvas background color does not change
I have 2 seperate files and trying to make a sort of 'module' with this one file. But it does not work.
The background color is still this weird gray color even if I set it to say, black.
Here is the '...
1
vote
1
answer
94
views
Tkinter can't delete something from a canvas on ubuntu
I created a programm on python to read serial data from an arduino and show it on a tkinter window. I made a Thread to read the from the arduino and the tkinter programm. My Programm runs perfectly on ...
2
votes
1
answer
71
views
Tkinter canvas rectangle appears with incorrect size depending on row/column – how to fix?
I am writing a Python tkinter rectangle function:
def Rectangle(row,col,color="#FFFFFF",outline="gray"):
"""
Fills a block with a color.
Args:
...
-1
votes
2
answers
80
views
Python CV2 and tkinter canvas
I have been working on face recognition tool and I have to draw a square on an image.
The problem is before the last line cv2.rectangle(photo1.....) because the image is not a cv2 it says I have given ...
1
vote
1
answer
102
views
Python 3.13.0's tkinter's canvas.itemconfigure returns an error for some reason
I am making a program called "Clocker" and i am using canvas.itemconfigure to change canvas.create_text text property, i think i am just using it wrong, but i want to upload this to be sure,
...
1
vote
3
answers
84
views
Ways to prevent tkinter from opening a graph on each plot drawn/draw in a selected frame?
I am working on a python tkinter GUI, for plotting/modifying plots for device calibration and data analysis. Basically, I want to list various columns of data and then select regions of said data for ...
0
votes
0
answers
88
views
Tkinter Grid stacking after 900+ elements
I am trying to create an expandable list viewer in python3.6.8 using tkinter grid.
I have a scroll frame that contains a list of element frames in a grid layout:
ApplicationWorkingProperlyIMG
This ...
0
votes
1
answer
79
views
Tkinter: Canvas item color change on state change
The Tkinter code below displays a root window containing a canvas and a blue rectangle.
Clicking on the rectangle toggles its state between 'normal' and 'disabled'.
I'd like to also toggle its color. ...
0
votes
0
answers
58
views
Why is the text placement different in 1755x1241 as compared to 900x650 in Python Canvas?
I am creating a GUI application that generates certificate based on the user input.
The problem arising is that the placement of placeholder text in 900x650 canvas image does not align with the ...
8
votes
4
answers
409
views
UI element for an infinite scrolling image gallery for 100k images: which data structure?
I'm making an (infinite) scrollable GUI that displays 100x100px thumbnails of possibly 100 000 image files (JPG), in Python Tkinter.
The MCVE code below works:
using lazy loading: it reloads 30 new ...
0
votes
1
answer
100
views
PysimpleGUI handling pictures with text in frames
I have used tkinter to organize pictures with text inside various frames on a canvas with a scrollbar. (as can be seen in the picture). I'm really struggling to achieve same functionalities with ...
0
votes
0
answers
29
views
python.invalid command name ".!canvas" [duplicate]
I am making a ping pong game, in the line code ball movement
ball.goto(ball.xcor() +2, ball.ycor() +2)
after run the code it appear me this error message
Exception has occurred: TclError
invalid ...
1
vote
1
answer
71
views
Python Tkinter Grid Column width Not expanding need First row not Scorallable
I have three column with scrollbar and it needs to be expand and it should be stretched the window size but i am unable to increase the column width according to the screen size and i need top first ...
0
votes
1
answer
45
views
Tkinter - Frame can scroll horizontally, but will not vertically size itself properly
I have a frame that is scrollable horizontally. That is working as desired.
I desire the frame to vertically size itself such that all widgets are displayed.
Currently, the frame will not grow as ...
0
votes
0
answers
174
views
How can the lateral movement be tracked by tkinters canvas.scale function?
I'm trying to figure out how the scale canvas.scale(tag, x, y, ds, ds) method works in the Tkinter canvas package. It is possible to move elements on the canvas without using the corresponding move ...
0
votes
1
answer
58
views
Is there a widget size limit Tkinter and/or a way to override it?
I'm not talking about maxsize(), which is the only thing that appears on Google.
I would like to know if there is a known pixel limit to a Tkinter widget, if it is for a specific widget or if it's ...
-2
votes
2
answers
81
views
Tkinter Scrollbar issue
Pleaase someone fix the scrollbaar for me and also add scrollbars for the third canvas.
Actually i have created data structure visualizer. and facing a scrollbar,cureently ia cant scoll to the third ...
0
votes
1
answer
52
views
Right-side canvas scrolls, even when mouse is on the Left-side canvas
I've been trying to make a program, with 3 layouts depending on the window's width (using Tkinter).
The issue is in the medium layout. Whenever I place my mouse onto the left canvas and use the ...
0
votes
1
answer
71
views
Load 2 Tkinter windows simultaneously. one with animation
The following script runs standalone to run a scenario:
The results are printed first, followed by the plot is closed with an animation.
import numpy as np
import matplotlib.pyplot as plt
import ...
0
votes
0
answers
54
views
Tkinter Plot becomes blurry when in a frame
TEST_PLOT.py
[![import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import tkinter as tk
class TestPlot:
def __init__(self, master=...
1
vote
1
answer
445
views
Pandas table error while try to get col positions
this is example of my code - im using tkinter with tabs and pandas table inside.
when im trying to insert data to a cell in the first tab im getting error
`
import pandas as pd
from pandastable import ...
1
vote
0
answers
82
views
Image Not being displayed in popup window
Here is the code:
import tkinter as tk
from tkinter import *
from tkinter import messagebox
import tkinter.font as font
from tkinter import ttk
from PIL import Image, ImageTk
def CustomerScreen():
...
0
votes
0
answers
48
views
Updating matplotlib graph using tkinter
I am writing a GUI using tkinter that has a graph inside the main and only window. I have to update the value of the graph every 2 seconds (as I received data every 2 seconds from a serial port). I ...
1
vote
1
answer
55
views
How to prevent canvas selection in tkinter?
I am currently developping an application using tkinter and I struggle with a cosmetic issue. When adding an entry to a canvas, tkinter displays a selection cursor around the entry and the canvas. I ...
0
votes
0
answers
39
views
TKinter based App for Vision system - Blank output
I have a Tkinter app for detecting the objects by importing images or videos from my system(using my custom model which predict fine when used via cmd predict function).
It works well, without any ...
2
votes
1
answer
142
views
tcl issue while running a python script from another python app (converted to exe)
I made an app in tkinter which helps creating tkinter app/scripts, (when I export the file it is stored as a .py)
I want to run this .py script from my app so that we can preview it immediately after ...
0
votes
1
answer
110
views
Python Tkinter: Window freezing on user click during update_idletasks()
I am trying to make an app in tkinter to visualize data structures and algorithms. However, I have an issue with the way the program is updating the canvas during the visualisation process. When the ...
-2
votes
1
answer
136
views
AttributeError: 'NoneType' object has no attribute 'create_image'
I am creating a GUI with Python's tkinter. I have encountered an issue while trying to place an image read by OpenCV onto a tkinter canvas.
The error is as follows:
AttributeError: 'NoneType' object ...
2
votes
1
answer
75
views
How can software save tkinter Canvas Rectangle geometry when the root window is closed?
My program displays a Rectangle on top of a video image on a tkinter.Canvas. A mouse handler lets the user move and stretch the rectangle to identify an area of the video for processing. When the ...
1
vote
3
answers
91
views
How to display an image with classes in tkinter?
import tkinter as tk
from PIL import ImageTk, Image
window = tk.Tk()
window.geometry("300x300")
canvas = tk.Canvas(window, width=300, height=300,bg="red")
canvas.pack()
class ...
1
vote
1
answer
106
views
TkInter Canvas flickering when drawing on it from a Thread
I'm trying to make a simultaneous drawing of plants, the plant is a class that contains the method get_circles() , and also is_growing() that returns the status of the plant. get_circles() returns a ...
0
votes
0
answers
98
views
Tearing in Tkinter while scrolling
I'm experiencing pretty bad tearing while scrolling around in Tkinter. My code so far is a bit complex, so I'll try to explain it by words: I'm using a scrollable Canvas which has a grid of Text ...
1
vote
2
answers
52
views
Moving an widget in a Canvas
I want to move a widget inside of a canvas with a click of a button. Unfortunatly I always get the same Error:"_tkinter.TclError: invalid boolean operator in tag search expression"
I've ...
0
votes
0
answers
48
views
How can I make a touch scrolling button in tkinter?
I have a list of buttons, and I want to make them scroll by touching.
I made a canvas, and it frame contained the buttons. Now, how can I make them scroll?
I have try this :
def on_button_drag_(event):...
0
votes
1
answer
166
views
Why are the bottom half of my card images getting cut off in tkinter?
I am coding a digital version of the card game Dominion to play with some friends. This is only my second time using tkinter for window management and I'm not very skilled at python in general. ...
1
vote
0
answers
97
views
Understanding Tkinter window, and Canvas sizes
I can’t get any information on exactly how window and canvas sizes work in Tkinter.
If I create a window, I can set its size using either the .configure() method or the .geometry() method. If I set ...
0
votes
1
answer
32
views
Frame with Scrollbar in Tkinter?
So I am trying to make a frame and fill it up with data from my database. Only thing is, I need the whole frame to be scrollable. I followed the instructions I saw online and also checked ...
0
votes
1
answer
73
views
Adding scroll bar destroyed the layout structure. How to fix it?
I am writing a small example with tkinter.
Here what I got (things are layouted nicely)
enter image description here
The codes for it are given below
import tkinter
from tkinter import ttk
from ...
1
vote
2
answers
142
views
how to fix the undo function for a paint app made using turtle and tkinter
i am making a paint app in python. it has functions for making shapes and drawing using click and drag.
i've been trying to implement an undo button to my app. it work fine to undo the shapes but not ...
1
vote
2
answers
59
views
unexpected behavior when inheriting the tkinter.canvas class
I'm working on a dragable tkinter canvas class that knows its position and scale, for that I would like to use a class that inherits from tkinter.canvas. However, the inheriting class behaves ...
1
vote
0
answers
63
views
activate() method inside Menu widget class of Tkinter
I am facing this issue where whenever I try to trigger the activate() method by clicking the command inside the Menu widget, I am not able to see the method in action because by default the Menu ...
0
votes
0
answers
60
views
How to calculate the click on the original pixel of the image after it has been panned, zoomed, and adjusted with the scrollbars
Issue
I am created a GridEditor program that generates a grid based on the dimensions provided and then allows you to paint patterns in each of these grid squares. I implemented a zoom and pan method ...