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 make a button with a command with the parameter/attribute of its name with tkinter?
How to make a button with a command with the parameter/attribute of its name with tkinter?
from tkinter import *
def openfile(name):
print(name)
for i in l:
if num == 2:
num = 0
y = y+100
x = 100
print(y)
…

Adam Basha
- 5
- 3
0
votes
0 answers
Tkinter Toplevel gets poped up when I run the code
I want the popup to appear after clicking the button but it gets popped up while opening the app
Here is the command for popup
import tkinter as tk
from tkinter import ttk
import sqlite3
def add_caster():
global firstname,lastname
add_cd=…

Prashant Priyadarshi
- 27
- 5
0
votes
0 answers
python pyserial tkinter disable button doesnt work
def x_control():
direction = direction_var.get()
steps = steps_var.get()
ser.write(bytes(f"XCONTROL {direction} {steps}\r\n", 'utf-8'))
y_button.config(state='disable')
z_button.config(state='disable')
this code work fine but…
0
votes
0 answers
How to paste values to entry box in same format Tkinter?
I want to paste below multiple values to my tkinter entry box but I have this output. How can I paste values in same format? Like one after another or paste them with splitting each one?
Example values:
12345
34232
56456
54353
87876

asena
- 1
0
votes
1 answer
Hello everyone! I wanted to make a math quiz game using tkinter in python. Problem is my scoring system isn't updating andI can't create new questions
So I created the window by tkinter. Every Button is functional, and connected to each other. I made a command to connect my 'equation_text' with 'question_label' so that when I write answer, let's say " 5+7=?" and I press buttons '1' and '2' (which…
0
votes
1 answer
Borderwidth resets when button clicked
So I'm making a flashcard game (in progress) and the correct button has a background. I set the borderwidth to 0, and that worked, but whenever I click the button (and it is being held down) the border comes back.
This is my code so far:
from…

Yugm Shah
- 15
- 6
0
votes
1 answer
Why are the circles of my radio button greying out on hover on my tkinter GUI?
I'm writing a GUI currently and I've run into some weird behavior. Everytime I hover over one radiobutton the others circles visually fill their circles as though they've been selected, but slightly greyed. I thought this was just a default…

Groggyboi
- 31
- 4
0
votes
1 answer
Tkinter reuse the same thread for another command?
The problem:
I would like to use this with an ESP32, to automate cli insructions. I have two buttons, the "Lets Go!!" button and the "Connect" button. "Connect" triggers def run which triggers def test and the command "rfq tty -P /dev/ttyUSB0",…

Swordfish II
- 3
- 4
0
votes
0 answers
Cant make changes to global list using a function activated through a tkinter button
I am working on a python project , a "Basketball scorecard" which uses tkinter.
my first window is where the user enters the names of players in the ballgame, I have used a simple submit button which grabs the values from the input boxes and stores…

Ullas
- 1
0
votes
0 answers
How to customize the tkinter default icon menu
The default menu which opens by clicking the window icon in tkinter as shown in the figure. How to customize it? I'm not able to do that.
I want to add some more options in the same like zoom in and zoom out.

Prashant Priyadarshi
- 27
- 5
0
votes
1 answer
tkraise is not functioning
I am trying to create two buttons to switch frame config by raising different Frame above an other. but the tkraise() function doesn't seems working... Please help to check if there are any mistake or concept error of using tkraise.
Thanks for…

Jammy
- 3
- 1
0
votes
1 answer
Customtkinter order of "bind" and "command attribute" seem to be different from normal tkinter
I have two classes, the main window (App class) and the frame class (Test). Inside the Test class i added a button (test_btn) which calls a method inside the class called "print_t" which simply prints "Test". On the main window class I add the Test…

Marcelo_M
- 13
- 3
0
votes
1 answer
Tkinter - After Second Button Click, Change Button Function to Close Window
I am trying to figure out a way to change a button's text and functionality after I have clicked the Submit button a second time. In the below instance, I am trying to:
1) Change the button's text from Submit to Close after I have entered in the…

arnpry
- 1,103
- 1
- 10
- 26
0
votes
0 answers
tkinter and Pylance: argument of type tuple cannot be assigned to parameter "command" of type none
I use VS Code as my IDE and I have Pylance extension to help debugging the code.
Pylance keeps underlining command=self.get_inputs as error even thought the code runs just fine. Here is an example:
self.button1 = ctk.CTkButton(self,…

Said Lababidi
- 1
- 2
0
votes
0 answers
The treeview item separator line gets vanished after applying the configured style
This is the style I implied
style_add_wear = ttk.Style()
style_add_wear.configure("add.Treeview", background="white", foreground="black", fieldbackground="white",font=('calibre', 12), sheight=10,…

Prashant Priyadarshi
- 27
- 5