Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter import messagebox
- root = Tk()
- label1 = Label(root, text="Username : ", relief=FLAT)
- label1.place(x=50,y=50)
- #another label
- label2 = Label(root, text="Password : ", relief=FLAT)
- label2.place(x=50,y=80)
- #add a text
- text1 = Text(root, height=1, width=20)
- text1.place(x=150,y=50)
- text2 = Text(root, height=1, width=20)
- text2.place(x=150,y=80)
- #add an event to the button
- def quitButton():
- root.destroy()
- #add a button
- Button1 = Button(root, text="OK", height=1, width=5, command = quitButton)
- Button1.place(x=150,y=120)
- Button2 = Button(root, text="Cancel", height=1, width=5, command = quitButton)
- Button2.place(x=250,y=120)
- root.geometry("400x200")
- root.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement