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
0
votes
1 answer

a software built to calculate Mento Carlo reliability

I set four RadioButtons for users to choose the type of distribution, then use a global variable s_val to record the type of distribution. However, no matter which button users choose, s_val always equals to 0. I wonder what causes this…
mayayang
  • 3
  • 2
0
votes
1 answer

How to control tkinter Button width with left alignment?

Consider this: from tkinter import mainloop, Button import tkinter as tk def cmd(): print('Hello World') class my_class(tk.Tk): def __init__(self): super().__init__() Button(self, text="Button A", command = cmd…
Ted Ersek
  • 119
  • 4
0
votes
1 answer

Tkinter Checkedbox in python is returning False for all Machines eventhough boxes are checked

I created a tkinter checkedbox to receive input from user to see which machines from date_and_time_dictionary they want to delete. You then press a tkinter button "Print Checkbox States" and if a box was checked the program will print out the…
R3CURSION
  • 23
  • 8
0
votes
0 answers

How Do I Make One File Run Another Twice? (python tkinter)

I know that using the code below allows you to open another file import file exec(open('file.py').read()) but it doesn't seem to work multiple times, well in tkinter button commands atleast. i expected it to work multiple times but it didn't seem…
Bonnie
  • 1
  • 1
0
votes
1 answer

Using python tkinter, how do I make buttons invisible?

As someone who is relatively new to coding, I am trying to create my own chess game. Currently, I am facing a challenge in attempting to make my buttons invisible while still allowing them to execute piece movements. Any advice or guidance would be…
0
votes
1 answer

Why might the bg attribute of a button on a tkinter program not be working?

I've just started learning tkinter, and I can't seem to get the background colour attribute of a button to work - I'm not sure why, as the foreground colour is working. I tried instantiating a button object with a text label, a simple command (that…
Cmdr. Data
  • 11
  • 3
0
votes
1 answer

Create tkinter buttons using a function

When i try to create buttons in a grid using a function (new_btn(r,c,btn)), the image on them gets removed and i cant click them exept for the last one. Its a 9*9 grid. I tried it using loops but then i was not able to set the row an colum of the…
QRY78
  • 3
  • 2
0
votes
0 answers

delete problem python and tkinter with sqlite3

here is my code def delete(): con = sqlite3.connect("Cadets2.db") cr = con.cursor() selectedItem = self.cadet_table.selection()[0] self.cadet_table.delete(selectedItem) …
Aperion9
  • 1
  • 1
0
votes
1 answer

Insert the same text in differents entry widget with same button is clicked Tkinter

I want to create a button in tkinter that prints text in different Entry depends if it clicked. The text to be displayed must be the same, but not at the same time. I have this code to try to get the result: from tkinter import * root = Tk() event…
Une
  • 3
  • 3
0
votes
1 answer

Create an editable tkinter treeview with keyword connection

I want to create a tkinter treeview with editable feature so I have got a sample code from 'So' itself. But instead of Ok button I want my keyboard 'enter' button to save changes. When I double click the element I can edit that but in addition to…
0
votes
0 answers

How to make refreshing window in Tkinter by using cycle "for"

I am trying to make an application which includes several tests. After receiving an answer to one question (the user must enter his answer and the application will tell him whether this answer is correct or not), you need to refresh the window and…
0
votes
1 answer

I am unable to change the bg of my button in tkinter

I am trying to make the button in my tkinter project look like the bootstrap success button but I am unsuccessful in changing the colour of it. Any extra beautification of the code would also be appreciated. change button colour to look more green…
0
votes
1 answer

Issue initialising the Tkinter button class when making an extension of it

I am using python 3.11 and Tkinter. I am making a colour palette creator using python and tkinter. I am using a class for the colors in the palette. Here is my code: from tkinter import * import tkinter as tk import random hexChars =…
0
votes
0 answers

Pycharm Macos Ventura 13.2.1 Tkinter GUI Black Screen Issue

code output After I updated my macos to Macos Ventura 13.2.1, I started to get black screen in tkinter python GUI.When I write the code attached, I get the attached output where the screen is black and the button is blinking. This even happens when…
0
votes
2 answers

Can't customize TKInter button

I want to make the bg of the button '#318CE7' this hex color, but no matter what I tried, the color did not change and when the application ran, the color of the button became white. bg_color = (49, 140, 231) bg_hex =…
Bektas
  • 3
  • 2