Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root = Tk()
- name = "einar"
- def radio1():
- root.configure(background='red')
- return
- def radio2():
- root.configure(background='blue')
- return
- def radio3():
- root.configure(background='green')
- return
- def radio4():
- root.configure(background='pink')
- return
- def check1():
- root.configure(background='yellow')
- return
- def check2():
- root.configure(background='red')
- return
- root.configure(background='red')
- root.geometry("900x700")
- realStatus = StringVar()
- realStatus.set(None)
- topframe1 = Frame(root)
- topframe1.pack(side = TOP)
- radiobutton1 = Radiobutton(topframe1, padx=92 , pady=32, bg='red', text='Rauður', value="1", variable=realStatus, command = radio1)#padx er stærð til hliða og pady upp og niður
- radiobutton1.pack(side=LEFT, anchor=W)
- radiobutton1 = Radiobutton(topframe1, padx=92, pady=32, bg='blue', text='Blár', value="2", variable=realStatus, command = radio2)
- radiobutton1.pack(side=RIGHT, anchor=E)
- topframe2 = Frame(root)
- topframe2.pack(side=BOTTOM)
- radiobutton1 = Radiobutton(topframe1, padx=92, pady=32, bg='green', text='Grænn', value="3", variable=realStatus, command = radio3)
- radiobutton1.pack(side=LEFT)
- radiobutton1 = Radiobutton(topframe1, padx=92, pady=32, bg='pink', text='Bleikur', value="4", variable=realStatus, command = radio4)
- radiobutton1.pack(side=RIGHT)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment