All Questions
981 questions
-1
votes
1
answer
66
views
My tkinter canvas scrollbar is very slow because there is a lot of rectangles I need solve
Image from programm i want to fix lag problem when i move scrollbar I made alot of rectangles by tkinter canvas python and when I move scrollbar to show all rectangles it is very slow and it is very ...
0
votes
0
answers
73
views
how to delete lines in python canvas one by one
I would like to delete line one by one after created but only last line delete. Here is my code:
import os
from tkinter import *
os.system("cls||clear")
def on_click():
global lines,...
2
votes
1
answer
70
views
Tkinter canvas object tag_bind causing memory leak
If I monitor the Windows task manager while a program of mine is running, I see a memory usage number that goes up continuously. I wrote the attached code to demonstrate the problem. Once a tag_bind ...
0
votes
1
answer
83
views
How to add scrollable buttons in tkinter python
Currently, I'm using a tkinter canvas to try scroll buttons. I put twenty buttons on the canvas and none of them scrolled like I expected.
import tkinter as tk
from tkinter import *
from tkinter ...
2
votes
1
answer
47
views
How do I create and freely delete parts of a black layer with python and tkinter
Using python and the tkinter library, I want to create a program that will open an image, then draw a completely black layer on top of it, and using mouse click + movement, delete parts of that black ...
1
vote
1
answer
74
views
tkinter canvas.delet('all') does not set the item count to 0
Root is my tk window and I'm using it's title to display debug data.
When I run this code the find_all keeps incrementing as if the items are still there but empty and not drawing on the screen. is ...
0
votes
1
answer
103
views
I want to make a ball animation continoulsy moving from top left to bottom right in python canvas
I am learning Python canvas Tkinter, I am trying to make a ball animation continuously moving from top left corner to bottom right.
The problem is that there is a ball when it leaves the top corner ...
0
votes
1
answer
80
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 ...
-1
votes
1
answer
26
views
Tkinter - binding individual shapes on a canvas
I have a list of coordinates for rects. I iterate through them to create rectangles on a canvas. I wanna bind every created rectangle to a callback so that I can edit each rectangle individually. ...
0
votes
1
answer
40
views
Is it possible to maintain the canvas background color while displaying a plot object on it?
I have the following code which generates and 3D surface plot:
import numpy as np
import matplotlib.pyplot as plt
# Creating a figure object
surf_3D = plt.figure()
# Creating a axes object
axes_3d = ...
0
votes
0
answers
29
views
Circle on a grid generated by canvas tkinter moves wrong way?
I have some logic up and running that controls how a circle moves through a Tkinter Canvas depending on which direction it is coming from, and I'm trying to make it act differently depending on ...
0
votes
0
answers
67
views
Why is canvasx(winfo_x()) returning incorrect values when the widget is not visible on the screen in customtkinter in python?
Here is my problem :
I try to developp an app using customtkinter in python. On the app, I have a scrollable canvas with another canvas as a widget. I would like to get the canvas coordinates of the ...
0
votes
0
answers
25
views
Photo won't load on canvas [duplicate]
I wrote this code as part of a bigger code but the arrow image won't show when I run the bigger program. However, if I run just my code (not the other code) it works just fine.
class Rating(tk.Tk):
...
0
votes
0
answers
82
views
Placing a rectangle on top of a progress bar in TKinter
I am having problems with Tkinter. I want to place a semi transparent rectangle on top of my progress bar (rectangle will be replaced by a picture).
The idea is, that I have a graph corresponding to a ...
0
votes
1
answer
53
views
the canvas is showing down
import customtkinter as ctk
from PIL import Image,ImageTk
import tkinter
def GoToAdkar():
Main_Canvas.pack_forget()
window = ctk.CTk()
window.geometry("450x600")
Main_Frame = ctk....
0
votes
1
answer
37
views
how to stop rectangle on edge of canvas while moving it by pressing 'a' or 'd' key
So I was trying to create a brick break game on canvas in python, I made a rectangular bar so the ball will collide on it and bounce back, well the problem is very simple and I couldn't find any
...
1
vote
1
answer
96
views
Load image using Tkinter in Python
I must be missing something, because my code doesn't work:
i have these 2 functions in a class compaClass:
def drawImgs(self):
canvas1.delete("all")
canvas1.create_image(0, 0, anchor=...
0
votes
1
answer
56
views
Pause and un paused Python tkinter canvas for loop?
When I click my program's tkinter (canvas) menu it cause pause and when I get rid off the mouse pointer from menu it cause un paused. How to create just this kind of pause in to my program's tkinter ...
0
votes
1
answer
47
views
How to set an individual mouse scroll on two different canvases that are connected to separate frames but the frames are one on top of eachother?
I know the title is a bit difficult to understand so let me explain it better here:
I have a class that is inheriting a selection that I've made in a previous window, now that class has a couple of ...
0
votes
1
answer
86
views
Drawing rectangle on angled line in Tkinter Python
I have a big project that shows movement of objects. I draw many of shapes according to each other but this one is little bit tricky for me. I spent many days to achieve it but I couldn't draw it ...
1
vote
1
answer
74
views
How to hide or show a canvas line controlled by sliders using Checkbuttom from Tkinter?
With the code below it is possible to control the amplitude and frequency of a triangular signal.
Just starting out with Python, I fail to hide or show a given signal using a Checkbutton from tkinter. ...
0
votes
0
answers
63
views
How to make python tkinter save new data to the CSV file already loaded in the application
This code will not create new data and save it to the Python file. Also if it it not too hard, can you please make it look better and easier to read? The Canvas is also really big even though I have ...
0
votes
0
answers
38
views
suddenly "pyimage2" doesn't exist
I am coding a automation interface using tkinter
i try yesterday that's code, very good working but suddenly faced with an error that says "image "pyimage2" doesn't exist",
# ...
0
votes
1
answer
207
views
Add text into rectangle into Canvas?
How do I create text in a rectangle in Tkinter Canvas?
Because, all what I can do is create 2 separate objects.
I have tried doing this:
rect = canvas.create_rectangle(0,0,100,100,fill="orange&...
0
votes
1
answer
146
views
Tkinter - Creating scrollable frame
I'm trying to create a scrollable frame with customtkinter following this guide. The result I'm trying to obtain is a series of frames packed one over the other just like in the linked guide. What I ...
0
votes
0
answers
73
views
How can I save what I did on my canvas widget as an image?
I've seen some questions on this topic regarding people drawing on the canvas and saving it as an image, however my problem is different:
I want to create a watermark desktop app where I can upload an ...
0
votes
1
answer
134
views
In Tkinter, i can't see the vertical scrollbar in an external file
If i select Tab2, i would like to see the vertical scrollbar in the my Verticalbar, but i can't see the vertical scrollbar (in an external file x.py). I specify that the verticalbar is located outside ...
-2
votes
1
answer
45
views
A tkinter canvas doesn´t show the image [duplicate]
i have this code:
def soltar(self, event):
directorio = event.data
directorio = directorio.replace("{","")
directorio = directorio.replace("}","&...
0
votes
1
answer
105
views
Tkinter - TopLevel Window Not Scrolling
I am creating a simple app for gym staff to use which allows them to do various things, one of which is open a membership form where they can sign up users.
When I open the membership form (toplevel) ...
0
votes
0
answers
59
views
how do I create two Canvas elements to always fill their horizontal half?
I'm working on a small GUI to compare two pictures.
So far it uses tkinter and some elements placed using .grid in rows 1 and 2; in row 3 I want to place two canvases that share 50-50 with the rest of ...
0
votes
1
answer
152
views
scrollbar movement for canvas
I need help with a canvas scrollbar. I made a canvas inside the tkinter window; placed a canvas and a picture in this window. There may be several pictures. Additionally, the code for the vertical ...
0
votes
1
answer
132
views
Problem getting widget coordinates after scrolling the canvas by a certain amount in python and customtkinter
I am new here and with python!
I am trying to create an application in python using customtkinter. The goal of the app is to define an optical bench with multiple components through a drag and drop ...
0
votes
1
answer
31
views
Can't resize box in canvas using tkinter
So my problem should be simple - I can't resize the box size in canvas using tkinter. I created a blank canvas and want to display information using a box (called profiling_box) within the canvas. But ...
0
votes
0
answers
73
views
Tkinter frame not appearing when using .place() but does when using .pack(), even with the same coordinates
I created a scrollable frame with buttons that are place using the .pack() method. It worked well but now I want to change it to .place() in order to have more control on the button placement.
Problem:...
1
vote
1
answer
53
views
Image does not appear in canvas, Python [duplicate]
I'm trying to create Images in canvas using python class. but when I run the code, Image does not appear. Here is my code :
import tkinter as tk
import ttkbootstrap as ttk
from ttkbootstrap.constants ...
1
vote
1
answer
49
views
How can I add a Turle drawing to a button that is in another button in Tkinter?
import turtle
from random import randint
import tkinter as tk
from turtle import ScrolledCanvas, RawTurtle, TurtleScreen
root = tk.Tk()
root.geometry("600x500")
root["bg"]="...
0
votes
1
answer
1k
views
<lambda>() missing 1 required positional argument
I use an image to a button in Tkinter. I want to pass the arguments with canvas.tag_bind.
here is my code:
canvas.tag_bind(obj1, '<Button-1>', lambda x,y: self.validateLogin(username,password))
...
0
votes
0
answers
85
views
How to add data to a tkinter canvas item?
I managed to create an infrared picture using a canvas filled with little rectangle items in a 32 x 24 array. Each rectangle has a color to visually create a heat map. The colors give some impression ...
0
votes
0
answers
68
views
Python Tkinter: How to fix image "pyimage1" doesn't exist
I have been working on a school project but for some reason the error "image "pyimage1" doesn't exist" exist during debugging. The error message pops up on the "logo_label = ...
1
vote
1
answer
65
views
GUI in a class with python + tkinter
I have a problem putting a GUI in a class. Loading an image from a file, resize and display it on a canvas works as long the complete code runs in main().
In the code below I do the same steps in a ...
1
vote
1
answer
25
views
Rectangles drawn on Tkinter Canvas are not drawn tightly with others
I tried to draw rectangles which will occupy the entire canvas
But, when I tried to do this, I noticed that between the rectangles there is an indent.
Like this:
I was expecting that rects will be ...
0
votes
0
answers
87
views
Creating arrows using Tkinter
I'm trying to implement a depth first search algorithm by myself. I'm trying to use the function draw_arrow, but the arrows are not showing up. Moving my draw_arrow function to after the window....
-1
votes
1
answer
54
views
Tkinter problem to get the values for more than one slider in a scrollable canvas
I can not fetch the values correctly for the different scalebars I created in an scrollable canvas.
If I move the sliders it changes allways the last entry.
Please advise if you have ideas to that ...
1
vote
2
answers
677
views
How to put a tkinter canvas item in top of other tkinter widgets placed in the same canvas?
I am trying to put a tkinter widget (placed inside canvas) behind a canvas item. I tried tag_raise method but it is not working. Moreover, I want them in the same canvas.
Is there any other possible ...
0
votes
1
answer
60
views
How to place image inside canvas in tkinter
def choose_image():
global image_object
filename = filedialog.askopenfilename(title="Select file", filetypes=(("PNG files", "*.png"), ("JPEG files&...
2
votes
1
answer
72
views
i need to make an image in the canvas in tkinter heres the code but errors are coming
c = tkinter.Canvas(width=275,height=300)
so_ramdom = tkinter.PhotoImage("/Users/vikranthracherla/Downloads/download.jpeg")
c.create_image(image=so_ramdom)
the error
Traceback (most recent ...
1
vote
2
answers
156
views
Why is the generated tkinter button-1 event not recognized?
I have 2 canvas rectangles, which have a binding for Button-1. Sometimes I want that when one rectangle gets this event, then the other rectangle should also get this event. So I have to duplicate the ...
0
votes
2
answers
52
views
Canvas.scale() does not work inside a for loop
I made a simple program to ask this question. I want to scale by steps inside a "for" loop the drawings inside the Canvas. But, Canvas.scale() doesn't work inside a for loop. The exp_scal ...
0
votes
0
answers
104
views
Move multiple images on Tkinter Canvas
I am working on an Image based project.
I want to move multiple images on a canvas in the horizontal, line by line (left to right).
Here is an example code:
from tkinter import*
from PIL import Image,...
6
votes
2
answers
135
views
Why does the parameter "disabledwidth" of a tkinter canvas rectangle not work?
I want the outline of a rectangle in a canvas to get a bigger width, when the rectangle is in state "disabled". Therefore I use the parameter "disabledwidth=4". But when the ...