Creating a SLIDER and Dialog Box in Python Tkinter GUI
from tkinter import *
import tkinter.messagebox as tmsg
from PIL import Image, ImageTk
root = Tk()
def rating():
tmsg.showinfo("Your Rating Us", f"Thanks for your time. You rated us as {scale_val.get()}")
root.geometry("700x400")
root.title("Sliders Tutor")
foto = Image.open("New folder\photo (4).jpg")
imageFD = ImageTk.PhotoImage(foto)
imageFD_label = Label(image=imageFD)
imageFD_label.pack()
Label(root, text="""You ordered food from our Service. How satisfied you are with our service.
(O for Not Satisfied at all while 10 for Absolutely satisfied)""").pack()
scale_val = Scale(root, from_=0, to=10, orient="horizontal")
scale_val.set(10)
scale_val.pack()
Button(root, text="Rate", command=rating).pack()
root.mainloop()
Comments
Post a Comment
Write something to CodeWithAbdur!