Questions tagged [tkinter-button]

Use this tag when you are referring to the tkinter button, created with the function tkinter.Button(). DON'T USE THIS TAG TO REFER TO ANY OTHER BUTTON.

346 questions
-1
votes
2 answers

Add a "Entry" widget with a button above said button in tkinter

I'm fairly new to tkinter and I need to make a button that adds a entry widget in the row above the same button, is it possible? from tkinter import * root = Tk() playerFrame = Frame(root) #Players' numbers and names / Numeros e nomes dos…
dkol
  • 27
  • 4
-1
votes
1 answer

Tkinter: Assign Variables with Value with a Button Click

I would like to make a Button that assign a new variable with a value in a compact form. I tried this: def whichButton(self, _var, _pressedButton): self._var = _pressedButton def checkScooter(self): self.checkScooter = Button(window,…
Marius1773
  • 23
  • 5
-1
votes
1 answer

my output is showing the tkinter widget error and button error and not displaying the button

the following was my code for creating to do list application from tkinter import ... // i have just not mentioned all imports root = Tk() root.title("My Todo List App") root.configure(background="light green") root.geometry("550x500") …
-1
votes
1 answer

Is there a way to change an image of an iteratively created button upon clicking it?

The buttons are being created in a larger loop iterating through i then j with the following code: btn[i][j] = Button(lbl_frm, width=24, height=24, image=unchecked_img, …
Dillon
  • 1
-1
votes
1 answer

Creating a list of buttons where each button remembers its appropriate command

I have created a list and a cycle that adds new buttons to that list. The only problem is that the buttons don't seem to remember their appropriate command and always have to call back to the variable x in the cycle. Buttons = [] for x in range(9): …
-1
votes
1 answer

How to change a tkinter button's text while clicking in python

Here is my code: buttons=[] for i in range(100): buttons.append(Button(parent,text="0",command=lambda:[change(i)]) def change(i): buttons[i]["text"]="1" but as finally, the i will go to 99, I could only change the last button no matter…
Cai Xuran
  • 1
  • 1
-2
votes
1 answer

Tkinter checkbox and button user input

I am facing a problem with tkinter checkboxes. So it goes like this: The user should be able to check multiple check-buttons, while the way I have coded this allows for only one check to be active at the time. I'd also like check boxes to not be…
-2
votes
1 answer

Switching between Tkinter screens with withdraw() method on button click

Everything here works just fine but I haven't found a way to make it so that when I press the start button it withdraws the Main Menu screen and displays the next one. It already creates the second screen when I run the code and it withdraws the…
-2
votes
1 answer

Program closes instantly after converting it with py2exe

I have a python program with a tkinter interface (the interface has 3 buttons, one of them is an exit button) which works perfectly fine. After i convert the program with py2exe to an .exe it instantly closes after i run the exe file. When i delete…
-2
votes
1 answer

Python, calling functions whitin functions; it does not give back the right value

I'm making a game where players guess a random number. If they answer fast, they get points. The game starts with entering names. A click on the button checks if names are filled in, pops a messagebox and then calls the function 'Timer': in which 10…
Djonie
  • 3
  • 3
-2
votes
1 answer

Two Command in Button Tkinter

I would like two put these two command in one button. I use for loop, to generate grid buttons. PC=Button(pc_area, text='RESERVE').pack() PC['command'] = lambda PC=PC:reserve_confirmation(PC) PC['command'] = lambda x=line: func(x)
shammeee
  • 1
  • 3
-2
votes
1 answer

Need help collecting data from buttons pressed. [Python]

I'm trying to create a roulette table (which I have done as a GUI). Now, when I press the button for the outcome it shows the number in my top box, but I'm struggling to find a way to collect the results in a list, so I can then later pull data from…
CT86
  • 1
-3
votes
1 answer

How to resolve image "pyimage16" doesn't exist in tkinter

Can anyone pls suggest how to get rid of the following error msg i am getting while trying to add background image to tkinter window. i have tried every possible thing i could but still no luck.Also, is it possbile to provide screenshot in output…
-3
votes
2 answers

when generating text the text displays how can I display the generated thing properly in tkinter python?

from ctypes.wintypes import SIZE from tkinter import * # import tkinter import secrets window = Tk() # creates window window.title('PassGen') # changes title window.geometry('600x400') # sets size window.resizable(False,False) # prevents user from…
-4
votes
1 answer

Wait only for 5 seconds for a button to be clicked else other player wins the game

I am creating a tic tac toe game where i have a condition, that if player does not respond within 5 seconds he loses the game. player responds by clicking a button. Do we have something like this to do? i tried implementing this by having a list of…
pavan
  • 102
  • 2
  • 11
1 2 3
22
23