Category "tkinter"

Tkinter scrollbar for frame

My objective is to add a vertical scroll bar to a frame which has several labels in it. The scroll bar should automatically enabled as soon as the labels inside

Why does Tkinter image not show up if created in a function?

This code works: import tkinter root = tkinter.Tk() canvas = tkinter.Canvas(root) canvas.grid(row = 0, column = 0) photo = tkinter.PhotoImage(file = './test.g

Tkinter button background color is not working in mac os

I am trying to change the bg color of a tkinter button on my mac (catalina) but instead of getting a colored background, it is showing a blank space in the layo

Error using Tk inter, when creating an event

So I have an assessment where I have to create a pygame using Tkinter, the objective is that you drive a Car and you have to dodge other cars that pass by, the

My Tkinter Python code returns "I/O operation error"

I am trying to create a code that will detect cursor coordinates upon user's entry and exit of the Tkinter window. However, I am not getting an output the first

How to get value from dependent combobox tkinter python?

I'm able to select both the combo box successfully but to print the second dropdown box value, I got lost. Could somebody explain how to print the Table value f

StringVar.get() doesn't seem to be entirely working (Tkinter)

The relevant code is this: import tkinter as tk from tkinter import ttk import quiz global menu_root def get_question(): question_input = question_respons

How can I detect long mouse clicks with tkinter?

I want to detect a long mouse click using tkinter. How can I do that? The <Button-1> doesn't help at all.

Why does Tkinter image not show up if created in a function?

This code works: import tkinter root = tkinter.Tk() canvas = tkinter.Canvas(root) canvas.grid(row = 0, column = 0) photo = tkinter.PhotoImage(file = './test.g

How to define the pen width in the menu bar

I am trying to write the code for my own paint program. I have added the menu for few basic color options. Now I would like to add the same menu style pen width

Python Image Library and Tkinter Clashing

I have an issue where PIL and Tkinter are not working together in the same program. Basically, I tried to run my program and when it was on the line 'image.open

remove highlight color when choosing a combobox value tkinter python

Is there an option to remove the color highlighting when the user chooses the value from the combo box drop down? I'm using the theme "clam" and tried other the

Python tkinter - Display all the checkbuttons selected

I created a GUI with 2 input boxes and a list of checkbuttons (derived from list 'a') with scroll. Now, I want to display all the checkbuttons which have been s

How to refresh tkinter window if requirements aren't fulfilled when pushing button

So I have a make story button, but I want it to be so if the entry boxes are empty or an adjective is not selected, it refreshes the window and does not make th

What is the reason of this error I'm getting when using tkinter for a math app

Im making a program that will do most of my homework. Im trying to add some ui and it gives errors in my code. Please tell what's wrong. Make it easy enough for

How to use Tkinter after method to give the impression of a wheel spinning?

I'm trying to create three separate 'wheels' that change the starting position of the first arc in order to give the impression of the wheel spinning. Tkinter w

How to draw on an image Tkinter canvas, PIL

I would want to be able to draw on an image being displayed by a tkinter canvas PIL. I tried google searching but all the results would be how to draw on an ima

AttributeError: 'str' object has no attribute 'tk' when click button [duplicate]

Here is my code: window = tk.Tk() version = tk.Label(text="hi", fg="orange", bg="black",

Error "takes 1 positional argument but 2 were given" when Tkinter slider callback

I am trying to use Tkinter sliders and buttons to adjust variables. Somehow when I move the slider, it gives this error message below. I have self on each of th

Strange bug when cycling dog photos

I have this code that generates a dog photo and can cycle through them. import tkinter, urllib.request, json, io from PIL import Image, ImageTk main = tkinter.