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
vote
1 answer

Local variable referenced before assignment (TKINTER)

I'm getting an UnboundLocalError Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1921, in…
c0nse1
  • 23
  • 4
1
vote
2 answers

How to make a tkinter entry widget for email only

I am building a simple login system using Tkinter in python, I want to take user email id by validating the user type value should be a email not anything else. How to make that, please any one tell me. This is the simple version of my code, from…
Kumara
  • 480
  • 1
  • 4
  • 13
1
vote
1 answer

Tkinter Checkbutton not updating for LED light control with PyMata

Trying to get my GUI to communicate with PyMata to turn an LED off and on based on the check button. The wiring and PyMata code is fine since I can get the LED to blink off and on again but I cant get the LED to turn off or on based on the…
Theta
  • 53
  • 7
1
vote
1 answer

How to open a link with an specific button? Tkinter

Basically, when I want to open a specific link with a specific button it won't work. When you click the second button, it opens all the links inside the function. from tkinter import * import webbrowser root =…
Edu
  • 23
  • 6
1
vote
0 answers

I've tried to update tkinter label from another function every time I pressed a button but it's not working as I wish it to work! Please Guide me

I'm trying to update my question label,result label everytime I press the submit buttn but it isn't working. It's not showing any error but it's not updating all the time but only a few times it's updating. Please help me. def submit():#to submit…
1
vote
1 answer

Tkinter - pass button grid values between classes upon clicking button

I am trying to create a basic Battleship game in Python using Tkinter. Below is a very simplified version of my code. Essentially I am creating a 10*10 grid of buttons and positioning them using .grid. What I'd like to do is click one of those…
Mazda Man
  • 13
  • 3
1
vote
2 answers

simple tkinter question - button command (display other text on click)

i've just started learning tkinter for python, and i'm trying to get the button to change its text when it's clicked on. this seems like a very simple question, but i can't find any answers. the code i'm using at the moment doesn't work - when the…
anji suri
  • 13
  • 5
1
vote
1 answer

Button Not Appearing in Tkinter

My Button is not appearing in tkinker (Python). Here is the main Code: # Start Of Manual Scanner ------------------------------------ manual = LabelFrame(tab_1, text="Manual") manual.pack(side=LEFT) main = Label(manual, …
JazzTGB145
  • 19
  • 4
1
vote
0 answers

Tkmacosx "WARNING: Appearance colours are not supported"

I'm recieving this message in the shell each time I run my Tkinter program: WARNING: Appearance colours are not either supported with the current tkinter or the colors doesn't exist on this Mac. However, the colours work and my button looks…
pesto_23
  • 11
  • 4
1
vote
2 answers

TKinter/TTK: Multiple elements in a clickable area

I was curious if it is possible to create an clickable element that contains multiple elements? ttk.Button appears to take text or an image. I would like to have a clickable element that will have 8 text items and 2 images inside it. Clicking…
eat-sleep-code
  • 4,753
  • 13
  • 52
  • 98
1
vote
1 answer

Button not showing up when canvas.create_window() is called

I am messing around a bit with tkinter in python, and i want to add some buttons to my canvas screen. But when i run the script, the button is not showing up on the screen. It's a little complicated, but I am creating buttons from a for-loop, then…
Itsjul1an
  • 301
  • 1
  • 2
  • 12
1
vote
0 answers

Tkinter button only responds visually after clicking out of and back into the window on Mac OSX

I'm having some issues with very basic button functionality in Tkinter. Using the code below, I open a Tkinter window with a simple button: from tkinter import * root = Tk() b = Button(root,text="Click Here") b.pack() root.mainloop() When I…
1
vote
1 answer

Is there a way to stop the flashing of buttons with image when clicked in tkinter?

When creating a button with an image on it you can specify its background color to be the same as the root background color with the bg='color' parameter so that if you have an image with transparent background the result seems nice. However for…
Thalis
  • 188
  • 2
  • 12
1
vote
1 answer

How to call multiple buttons together in Tkinter

I'm trying to create a window with 3 buttons. When a user clicks on one of the buttons, the assigned function is called. Here is my code, I tried everything from what I read in the documentation, but I can't seem to get over it! I also added the…
1
vote
1 answer

In Tkinter, How does padx differ when used as argument within a widget and an argument in the grid function?

from tkinter import * window = Tk() x = Button(text="a", padx=20) y = Button(text="aaaaa", padx=20) x.grid(padx=20) y.grid(padx=20) window.mainloop() Despite having the same padding values, x and y buttons have the same size and are displayed…
Kun.tito
  • 165
  • 1
  • 7