Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- def fn1(e):
- print("Это жмааааааак")
- root=Tk()
- btn=Button(root)
- btn["text"]="Жмак"
- btn.bind("<Button-1>", fn1)
- btn.pack()#автоматически в родительском окне
- bt2=Button(root,text="кнопка 2", width = 20, height = 20, bg="blue", fg="yellow")
- bt2.pack()
- lb=Label(root,text="это просто текст", font="Arial 18")
- lb.pack()
- ent=Entry(root, bd=3)
- ent.pack()
- txt=Text(root,width=40,font="Verdana 12",wrap=WORD)
- #txt.pack()
- var=IntVar()
- var.set(1)
- rb1=Radiobutton(root,variable=var,value=0,text="Первый")
- rb2=Radiobutton(root,variable=var,value=1,text="Второй")
- rb3=Radiobutton(root,variable=var,value=2,text="Третий")
- rb1.pack()
- rb2.pack()
- rb3.pack()
- c1=IntVar()
- c2=IntVar()
- che1=Checkbutton(root, text="первый флажок",variable=c1,onvalue=2,offvalue=0)
- che2=Checkbutton(root, text="второй флажок",variable=c2,onvalue=2,offvalue=0)
- che1.pack()
- che2.pack()
- r=['Linux','Python','Tk','Tkinter']
- lis=Listbox(root,selectmode=SINGLE,height=4)
- for i in r:
- lis.insert(END,i)
- #r.pack()
- lis.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement