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.
Questions tagged [tkinter-button]
346 questions
0
votes
1 answer
How to get a specific button to insert a value to a specific entry box in a series of buttons and entry boxes made by a for loop?
I am working on a Tkinter project that is basically like a app for the game "MadTakes"
How it works:
The player gets asked to "Enter a noun" or a pronoun or any type of word. Once he has entered all the words, that person can press "Go!" and a story…

Karan Hathwar
- 1
- 1
0
votes
1 answer
How do I create a scrollbar when using a grid in tkinter?
I'm a little bit stuck on this problem regarding my program. I tried adding as many comments as possible to give a sense of what everything does in the code, but essentially. The program has a field and value entry box. When the "add field/value…

Sloxy
- 82
- 10
0
votes
2 answers
How do I get the return from button
how do i get the return from button command
also tried without lambda doesn't work
import tkinter as tk
#value = ''
def button(e,f):
#global value
value = e.get()
f.destroy()
return value
def display(root):
value=''
f =…

Bind
- 25
- 2
0
votes
0 answers
Python Tkinter Code- TypeError: 'Button' object is not callable
I have ensured the button names do not resemble any function yet this error still shows when i try to use trigonometric or any log/other functions imported from math. I am building a scientific calculator, and while i am successfully able to…

user95434
- 19
- 2
0
votes
1 answer
Can a button's command use variables from the function including the button?
I have a function which creates some labels and input fields and a button. I want the button's command function manage objects from this function. Can I do this without making variables global?
Here's the code:
def add_clicked():
…

matined
- 13
- 1
- 5
0
votes
1 answer
add multiple buttons in tkinter(image converter)
I tried building this all-in-one image converter(basically its just png,jpg,jpeg,webp), it was supposed to let the user select a image and convert it into one of the above given formats(one at a time). But, when i try running it only the getImage()…

Akash Sharma
- 134
- 1
- 3
- 13
0
votes
1 answer
tkinter how to change a button's look/image in a specific state (disabled)
I made my own button (so I'm using an image), it's just like decoration, it has to stay where it is but also be unclickable, when I set it to "disabled' state it gets a very ugly filter on it:
How can I make it unclickable without that ugly filter…
user13112566
0
votes
2 answers
How to Make MacOs Tkinter Button Look Like Windows Tkinter Buttons
I'm using tkinter to make a calculator. However, whenever I use buttons I'm stuck with the ugly look of the macOS buttons and I's like to make them look like the ones on Windows. I'm also not able to change the background color. I've tried to use…

Code With Anish
- 95
- 1
- 1
- 12
0
votes
6 answers
How can i make one function repeat by pressing button several times in Python tkinter?
from tkinter import *
root = Tk()
numL = 0
numD = 0
root.geometry("200x100")
def like():
root_label1.config(text=numL+1)
def dlike():
root_label2.config(text=numD+1)
root_button1 = Button(root, text="Like", command=like)
root_button2 =…

AaYan Yasin
- 566
- 3
- 15
0
votes
0 answers
changing label text multiple times during one button click Tkinter python
if I link a button to a function that changes a label's text and press the button, the function will be run and when the function is finished, the label will only output the function's last change to the label's text even if multiple changes happen.…
0
votes
3 answers
Can you make a functional invisible button in tkinter?
Can I make a button that is functional yet isn't visible? I've looked into a bunch of Tkinter threads, but when I tested the codes, they all led to the button completely disappearing and being disabled. Here is what I've got so far:
import tkinter…

nickberredo
- 1
- 2
0
votes
1 answer
How to place buttons in tkinter side by side and fill Y at the top of the widget
I am trying to align three button at the top of my widget side by side and fill "Y" and "X" without changing the placement of the text widget which is just under them. I tried to place the button side by side using those anchor=NW,N,NE but it's not…
user13112566
0
votes
0 answers
How to bind buttons in a for loop in Tkinter?
I'm trying to bind a function to all the buttons in my App and pass Extra Parameters as well
However, all the buttons getting the same parameters instead of a unique parameter for each one(the parameters of the last button in the for loop)
Any…

Naveh Mevorach
- 21
- 5
0
votes
2 answers
How to divide space equally between widgets using Grid Layout Python Tkinter
I want to divide space equally between three buttons using Grid Layout in Tkinter. And those buttons should occupy the space equally even when the window is resized horizontally.
################################
#| btn1 || btn2 || btn3 …
0
votes
1 answer
Widget as argument to command option of widget
I want to deactivate the button when user presses it. As there are lots of buttons in GUI that I'm making. I want to generalise this.
I am doing it the following:
def deactivate (btn):
btn.configure(state='disabled')
print ('Button is…

Satish Thorat
- 584
- 1
- 5
- 13