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
0 answers

Python, tkinter grid: Prevent row from growing

I am pretty familiar with python, however right now I am creating my first program with user interface using tkinter. I have a grid layout in my scenario in column 3, row 1 (it is the second row and fourth column I am including row/column 0 here) is…
BB23
  • 173
  • 9
-1
votes
1 answer

python tkinter example generation problem

Help with the code, I wanted to make a program that asks what number we will learn the multiplication table for. Immediately the user enters a number, then a new window opens and displays random examples with this number, the user enters the answer…
-1
votes
1 answer

Tkinter - Toplevel not working when created in a function

I don't know what I'm doing wrong but when I create Toplevel in a function it doesn't recognize it as a global variable. When I put global or nonlocal before the creation of the toplevel widget, a message stating that there's invalid syntax is…
-1
votes
1 answer

Why does my tkinter button work with two command arguments, the second one as "comm" but not any other name?

As the title says, my create_button function doesn't give an error when using a command as a lambda function and another as "comm". Here is a code snippet to make the question more clear: self.create_button("pi", 8, 1, comm=self.pi) …
-1
votes
1 answer

I have saved my signup details in a csv file and while loging in I want to verify whether the data is valid or not. But I am facing errors

Saving Sign Up details # Function to save the sign-up details to a dictionary and display a confirmation message def save_sign_up(): forename = forename_text.get() dob = dob_text.get() username = username_text.get() …
-1
votes
1 answer

TKinter button won't work if inside function

I have this code import tkinter as tk from tkinter import ttk class Window(tk.Tk): def __init__(self) -> None: super().__init__() self.mainloop() I want to add button with image to it import tkinter as tk from…
wojtas558
  • 1
  • 2
-1
votes
1 answer

How to make tkinter GUI eraser, with given function?

I don't know what to do with the code to erase the lines please help. I am using a tkinter library and PIL. DEFAULT_PEN_SIZE = 5.0 DEFAULT_COLOR = 'black' def __init__(self): self.root = Tk() self.pen_button = Button(self.root, text='pen',…
user21549992
-1
votes
1 answer

Tkinter button size is not accurate

I want to set the size of a button in Tkinter, but it won't be as big as I want. It should be 100 pixels high and 100 pixels wide, but the button almost takes up the 800x600 window. enter image description here I am using this code to do the…
-1
votes
2 answers

i try to delete Label but i can't delete & my code a lot of line need somebody to advice

I'm writing a Tkinter Application. I'm trying to delete a Label by using destroy() but it is not working correctly. What would be the correct way to delete (or remove) the Label. Base code: typeimport tkinter from tkinter import * from tkinter…
-1
votes
1 answer

How can I change the width and height of a tkinter ttk Button (showing only text) in pixels?

for my application I designed a simple on screen keyboard (OSK), it is needed on touchscreens but may be used also with the mouse. Initially the happlication had to run on 1920x1080 screens only, but now I have many requests to port on different…
Massimo Manca
  • 385
  • 1
  • 2
  • 15
-1
votes
1 answer

'str' object has no attribute 'plot'

Consistently getting above stated error when I try to call a function using the tkinter button. So here is the example code used for this particular issue. import tkinter as tk from tkinter import * from tkinter import filedialog import pandas as…
-1
votes
1 answer

bad window path name ".!button3" message appearing after tkinter loops around the code again

I'm trying to make my program be able to reopen and reuse as if it was run for the first time. tkinter giving me (bad window path name ".!button3") message when it loops around and detects a button. Tried changing the buttons name. Instructions to…
-1
votes
1 answer

Extract text from Entry Box ktinker Python

I have a tkinter project and need the text, I put it in the Entry box, printed it in the console. but when I use get() I get empty space in the console. this is my interface. when I put 1234 I could place it above when I click the button "Pull…
-1
votes
2 answers

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

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 changes from…
Bradkik
  • 13
  • 2
-1
votes
2 answers

How to assign different arguments to command of tk.Button (that have the same name) that is created from a loop?

root = tk.Tk() root.title("Root") root.configure(bg = "#333333") root.geometry("600x500") root.resizable(False, False) def Category(category): y = 40 category_list = [['Refrigerator', 'Refrigerator', 'Refrigerator',…