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 open another window and close the current window after clicking button?
I'm new to Graphic User Interface using Python. I was trying to open the Register page after clicking the "Register" button from the Login page. Then, return to the Login page when clicking "Return to Login". But it did not work.
login.py
from…

Cristian
- 155
- 8
0
votes
0 answers
How can I scroll down multiple button widgets in tkinter?
I've already tried creating a scrollable canvas and making the widgets it's children. It doesn seem to work. Here's the code I'm working with:
#CALENDAR
##Setup
container = Frame(root)
container.pack(fill=X)
scrollable_canvas =…

Gregor Pircher
- 3
- 1
0
votes
1 answer
Tkinter moving buttons in a class for having multiple windows
I'm really new to tkinter and I want to experiment with using multiple windows in tkinter. I have borrowed the code from here:…

noahboiii
- 3
- 3
0
votes
2 answers
Tkinter bind button work incorrectly when hovering
Why my Tkinter bind buttons work incorrectly?
When I go on the start button with the mouse, about button will change!
show image
This is my code:
import tkinter as tk
class Panel(tk.Tk):
def __init__(self):
super().__init__()
…

erfannjz
- 3
- 2
0
votes
1 answer
Tkinter issue 'list' object has no attribute 'tk'
I am working on a tkinter project and am having issues creating a number of buttons using a for loop. When I try to create buttons within a loop, I get the error 'list' object has no attribute 'tk'. I am using two lists generated from a table in db…
0
votes
0 answers
Tkinter buttons calling functions without pressing them
I've had this problem for a while. When I start a program, any tkinter buttons will call their functions without being pressed or anything. and after that, I cannot use the button anymore because it only works once for some reason. Can anybody…

Spiceinajar
- 101
- 1
- 10
0
votes
0 answers
How to disable the filter being applied to an image in a dissabled button in tkinter
When I dissable a button with a image on it, the image gets a white filter over it. I want to disable that filter, while keeping the button dissabled.
import tkinter
import PIL
import PIL.ImageTk
root = tkinter.Tk ()
img = PIL.Image.new (mode =…

Sagitario
- 102
- 8
0
votes
2 answers
How to insert data in a Text widget with a button
I created a Top level widget with a text widget and a button, How do I insert text into the Text widget with a click of a button.
My Code:
def Networking():
top = Toplevel()
top.title("Networking")
top.geometry("800x800")
style =…

Mike Cash
- 317
- 4
- 13
0
votes
1 answer
I want to upload a file and extract it using python tkinter button but getting error in it
I am trying to upload the zip file from one function and extract that file by getting the path in a variable from another function but couldn't get the solution. below is the code of my user-interface and attach is the UI link.
from tkinter import…
0
votes
0 answers
Clearing a list when tkinter button is clicked
I have a piece of code below, I have a button (prnt_button) that must empty a list and a text box, but unfortunately, it empties only the text box, how could I change the code, so that the button empties also the list?
# This is in a for loop, you…
user17825405
0
votes
1 answer
If statement with buttons
so I have a problem.
Im trying to make a program with buttons, so you could choose something with buttons.
Im running python 3.
I made the buttons, customized them, everything is good with the buttons.
def choiceFirst():
choice = 1
…

Super Boxes
- 17
- 4
0
votes
1 answer
how to pass button value from custom widget to main application in tkinter when clicked
I have created a custom widget for tkinter that lays out 5 buttons. The widget works beautifully for the most part. The problem is that I cannot figure out how to pass the button that the user presses in the widget to the main application. The…

Greg G
- 135
- 1
- 11
0
votes
1 answer
Tkinter with Python 3.7.9, Change button colour when clicked, then back when clicked again
I'm having difficulty figuring out how to change the colour of a button in python using tkinter. All the tutorials I've seen show how to change the colour while the button is pressed.
For instance
from tkinter import *
root =…

Hartsmr
- 1
0
votes
0 answers
Window moving behind other open windows when button pressed (Python with Tkinter)
Apologies if this is a completely easy fix and I've just missed it. I am learning Python and I am trying to develop a GUI alongside my backend code using Tkinter. This is completely foreign to me and I have recently come across the problem that when…

kenos_x
- 41
- 6
0
votes
1 answer
Destroy button before create new in function
Here is my function, it generates 4 buttons with different values, but what I would like is to destroy the buttons previously created.
def bouttonedSeg():
segments = randSeg()
b1 = Button(fenetre, text=segments[0],…

VictorHugo
- 1
- 1