Questions tagged [tkinter-canvas]

The Canvas widget provides structured graphics facilities for Tkinter. This is a highly versatile widget which can be used to draw graphs and plots, create graphics editors, and implement various kinds of custom widgets.

The Canvas widget provides structured graphics facilities for Tkinter. This is a highly versatile widget which can be used to draw graphs and plots, create graphics editors, and implement various kinds of custom widgets.

The canvas is a general purpose widget, which is typically used to display and edit graphs and other drawings.

Another common use for this widget is to implement various kinds of custom widgets. For example, you can use a canvas as a completion bar, by drawing and updating a rectangle on the canvas.

The Canvas is the only scrollable widget in Tkinter. This is useful for more complicated GUIs where there may not be enough space for all the widgets.

Source

1963 questions
0
votes
0 answers

Python Tkinter Scrollbar just resizes the frame it is in instead of making the canvas scrollable

I´d like to make a scrollbar to scroll over a canvas filled with pics. The Problem i´m facing is, that instead of using the scrollbar the frame just gets bigger. No matter what I do the Frame always resizes with the the canvas filled with pictures.…
0
votes
2 answers

Trouble calling a function from a class to draw an oval in Python

Beginner here trying to make sense of classes. Below is the code for my class Cell: import tkinter import random top = tkinter.Tk() canvas = tkinter.Canvas(top, bg="grey", height=400, width=400) canvas.pack() class Cell: def __init__(self, x,…
0
votes
1 answer

tkinter buttons function in canvas doesnt executes code in right order

I am currently writing a slightly changed version of Conway's game of life and I am experiencing issues with the GUI. When I delete line 63 (buttonPressed(canvas,newIMG,arNew,x,y)) everything works fine and the image in the canvas gets updated…
0
votes
0 answers

Picking (pick_event) the correct artist on tkinter canvas?

I am trying to use the pick_event in matplotlib within the tkinter framework. I have a problem with picking the right artist on the plot. I have multiple annotated artist on the plots with arrows connecting the annotated points, and I am trying to…
user3840530
  • 290
  • 1
  • 4
  • 14
0
votes
1 answer

Tkinter: Button in a rectangle on a canvas of frame in Python 3.

I have been trying to create a moving oval that is more like a button. As of now I don't intend to perform any function on clicking the button, so I have created a pass function. The scenario is as follows: The frame in the tkinter window is…
0
votes
1 answer

Python Tkinter scrollbar in canvas

I'm trying to do a scrollbar on the right side of the canvas ( the window ), but the scrollbar won't even show when plotting. What am I doing wrong? from tkinter import * # create canvas root =…
Emelie
  • 1
  • 1
  • 2
0
votes
1 answer

python tkinter - track and save mousecklicks to build canvas items

I programmed a method like this on a canvas: When I press button1, the variable "state" changes to 0 and every click on the canvas results in a circle When I press button2, the variable "state" changes to 1. When the item that I clicked is a…
buttercup
  • 3
  • 3
0
votes
1 answer

Python Tkinter: How to create_line with multiple points in a list/tuple?

There is a list of coordinates that I want to draw lines through on the Tkinter canvas: points = [(1,1), (2, 2), (3, 3), (2, 0)] # etc. This is could have 100 points or more The next step would be calling the function create_line, but it can't…
Dave N.
  • 138
  • 1
  • 8
0
votes
2 answers

How to make move objects slower

I've made this code to create bubbles which move from the right side to the left side of the screen in tkinter: from tkinter import * window = Tk() c = Canvas(window, width=800, height=500, bg="darkblue") c.pack() list1 = list() speedlist =…
Timmy
  • 125
  • 1
  • 11
0
votes
0 answers

Add lable, textbox and button to tkinter canvas

How to add a label, textbox and button to a program in which an image is display using tkinter canvas. In this program, an image is displayed to user. Lines are drawn over image on mouse click at different position. I want to add a textbox and a…
john
  • 101
  • 1
  • 14
0
votes
1 answer

Python Multiprocessing Drawing to Tkinter Canvas

I have a program which uses multiple cores to process images before drawing to a canvas for a main view (using multiprocessing). I would like to know the best way to tackle this problem. Is it possible to have each core drawing to its own canvas…
DiscreteTomatoes
  • 769
  • 1
  • 14
  • 30
0
votes
1 answer

How to create polygon on mouse clicks on image in canvas tkinter python

The task is to create multiple polygons on image by mouse clicks on different positions on image. I used Python tkinter for this task. I displayed the image to user. I got the x,y co-ordinates when user clicks on image. How to create polygon from…
john
  • 101
  • 1
  • 14
0
votes
1 answer

avoid canvas create_window overlap other widgets

I am making a minesweeper-like game with python 3.6 tkinter on Windows. I used the code from https://stackoverflow.com/a/47985165/8110056 . However, the create_window object overlapped other widgets when scrolling. I have tried to wrap the canvas…
Harry Noob
  • 1
  • 1
  • 1
0
votes
1 answer

Python TK, strange issue with displaying image on Canvas

So I am having the strange issue with TKinter in python. I have a BitmapImage I checked the image before making it a ImageTk.BitmapImage object. I then tell the canvas object to create the image and then pack(). The image will only display if I put…
CaptObvious
  • 31
  • 1
  • 5
0
votes
1 answer

Tkinter grid can't place anywhere but dead center of screen

So I just need a photo for a background, and then a button in a certain spot. I have the background image loading, but now when I try and place the button it will only go straight into the center of the screen. If I make the column or row anything…
Hayden
  • 147
  • 1
  • 1
  • 10
1 2 3
99
100