tkinter-button

Python Tkinter Button not appearing

Python Tkinter Button not appearing Question: I tried to create two buttons, a ‘Ratings List’ button and a ‘Rankings List’ button. The ‘Rankings Button’ appears as it should, but the ‘Ratings Button’ does not appear at all. This is the code that I am using: #Creating a new screen screen = Toplevel(root) screen.title("App") screen.geometry("925×500+300+200") screen.config(bg="white") …

Total answers: 1

How to Disable a button while keeping the style in tkinter?

How to Disable a button while keeping the style in tkinter? Question: I made this simple Tic Tac Toe game code but I Encountered a problem when it comes to disabling a button. The buttons have a style attached to them, but after the player choses a button and it get’s disabled, the button’s background …

Total answers: 2

How do I change a Checkbuttons state in TTK?

How do I change a Checkbuttons state in TTK? Question: I’m creating a list of Checkbuttons which highlight when selected, when another Checkbutton is selected I want to deselect the other buttons, I have two buttons in my code when my button ‘create booking’ is toggled on or off it calls clear_previous_selection. Here I try …

Total answers: 2

How to make a tkinter button sit below other buttons?

How to make a tkinter button sit below other buttons? Question: I am currently in the middle of coding a small app which involves a menu written in tkinter (python 3.11) I have two option buttons, and I want to add an exit button under them. Currently it looks something like this: import tkinter as …

Total answers: 2

lambda i=i: not giving result for button in loop

lambda i=i: not giving result for button in loop Question: I’m new to coding and tkinter and after looking for solution to create button in a loop I ended on this solution: while x <= 10: btn = Button(text=x).grid(row=1, column=1) window.bind(‘<Button-1>’, lambda x=x: print(x)) But this solution return: <ButtonPress event state=Mod1 num=1 x=57 y=12> and …

Total answers: 1

Tkinter buttons resize, when longer text is displayed on them

Tkinter buttons resize, when longer text is displayed on them Question: I am making a program that can launch files and programs like a Stream Deck. After selecting the file I want to assign to a button, the button resizes due to the filename being wider than the placeholder text "Add". I couldn’t find any …

Total answers: 1

binding Label in tkinter while function runs

binding Label in tkinter while function runs Question: I have a code where by clicking button, function runs. But inside function there are two labels that I want them to appear with text inside labels while python runs from top to bottom inside function. As it displays in cmd if they were print() statements, whenever …

Total answers: 1

Tkinter changes the wrong button background when button pressed

Tkinter changes the wrong button background when button pressed Question: I have an array of buttons, when I press a button the button’s position in the array is printed but the color is not changed. Instead the color of the button at the bottom of the respective column is changed. Here I have pressed 0, …

Total answers: 1

Getting button input from module on tkinter python

Getting button input from module on tkinter python Question: I am working on a project that uses buttons, but I would like to make it modular. The only problem I can’t seem to get pass by is getting if someone is pressing the button from a different file -file 1 from tkinter import* class app2: …

Total answers: 1