Learn Python tkinter GUI buttons easy 🛎️

Pubblicato il: 01 agosto 2020
sul canale di: Bro Code
77,937
1.8k

You guys don't need all the button.config() calls, you can place them within the constructor if you want. I like to add comments line-by-line for teaching purposes to help explain. Do what works for you.

Python Tkinter GUI button tutorial for beginners
#Python #Tkinter #GUI #button #buttons #tutorial #beginners

button = you click it, then it does stuff

from tkinter import *

count = 0

def click():
global count
count+=1
label.config(text=count)
#label2.pack()

window = Tk()
button = Button(window,text='Click me!!!')
button.config(command=click) #performs call back of function
button.config(font=('Ink Free',50,'bold'))
button.config(bg='#ff6200')
button.config(fg='#fffb1f')
button.config(activebackground='#FF0000')
button.config(activeforeground='#fffb1f')
image = PhotoImage(file='point_emoji.png')
button.config(image=image)
button.config(compound='bottom')
#button.config(state=DISABLED) #disabled button (ACTIVE/DISABLED)
label = Label(window,text=count)
label.config(font=('Monospace',50))
label.pack()
button.pack()
label2 = Label(window,image=image)
window.mainloop()


In questa pagina del sito puoi guardare il video online Learn Python tkinter GUI buttons easy 🛎️ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 01 agosto 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 77,937 volte e gli è piaciuto 1.8 mille spettatori. Buona visione!