Answers for "button with terms and conditions"

0

button with terms and conditions

from tkinter import * 

def activate_submit():
    if var.get()==1:
        btn['state']=NORMAL
    elif var.get()==0:
        btn['state']=DISABLED 
    else:
        print('something went wrong!')

ws = Tk()
ws.title("PythonGuides")
ws.geometry("400x300")
ws['bg']='#5d8a82'

var = IntVar()
cb = Checkbutton(
    ws, 
    text="Terms & conditions", 
    onvalue=1, 
    offvalue=0,
    variable=var,
    font=("time", 16),
    command=activate_submit,
    bg='#5d8a82'
    )
cb.pack(pady=50)

btn = Button(
    ws, 
    text="Register",
    command=None,
    state=DISABLED, 
    padx=20, 
    pady=10,
    relief=RAISED, 
    font=('times bold', 14)
)
btn.pack()

ws.mainloop()
Posted by: Guest on June-02-2021

Code answers related to "button with terms and conditions"

Browse Popular Code Answers by Language