Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. from tkinter import *
  2. from tkinter import messagebox
  3. class Window(Frame):
  4.  
  5.  
  6. def __init__(self, master=None):
  7.  
  8. Frame.__init__(self, master)
  9.  
  10.  
  11. self.master = master
  12.  
  13.  
  14. self.init_window()
  15.  
  16.  
  17. def init_window(self):
  18.  
  19. top = Tk("Hello")
  20. L1 = Label(top, text="User Name")
  21. L1.pack( side = LEFT)
  22. E1 = Entry(top, bd =5)
  23.  
  24. E1.pack(side = RIGHT)
  25.  
  26. label = Message( self, text="last update 25/02/17 13:58", relief=RAISED, bg="#72726a", borderwidth=0, highlightthickness=0)
  27.  
  28.  
  29. label.pack()
  30. label.place(x=100,y=800)
  31.  
  32. self.master.title("EZ-MEAL")
  33.  
  34. self.configure(background = "#72726a")
  35.  
  36. self.pack(fill=BOTH, expand=10)
  37.  
  38. logo = PhotoImage(file="Capture.gif")
  39.  
  40. w1 = Label(self, image=logo, borderwidth=0, highlightthickness=0)
  41.  
  42. w1.image = logo
  43. w1.pack()
  44. w1.place(x=700,y=400)
  45.  
  46. quitButton = Button(self, text="Exit",command=self.client_exit, height= 5 , width =15, bg = "#e0b93a" , fg = "black")
  47.  
  48. quitButton.place(x=700, y=700)
  49.  
  50. AcceptButton = Button(self, text="Accept Order",command =self.OrderAcceptedNotification, height= 5 , width =25, bg = "#e0b93a" , fg = "black")
  51.  
  52. AcceptButton.place(x=300, y=200)
  53. orderisreadyButton = Button(self, text="Order is ready",command =self.OrderisreadyNotification, height= 5 , width =25, bg = "#e0b93a" , fg = "black")
  54.  
  55. orderisreadyButton.place(x=500, y=200)
  56.  
  57. listbox1 = Listbox(self,height =30, width =25,bg = "beige")
  58.  
  59. listbox1.pack()
  60.  
  61. listbox1.insert(1,"Number of the Order:")
  62. listbox1.place (x=100,y=300)
  63.  
  64. listbox2 = Listbox(self,height =30, width =25, bg = "beige")
  65. listbox2.pack()
  66.  
  67. listbox2.insert(1,"type of food:")
  68.  
  69. listbox2.place (x=300,y=300)
  70.  
  71. listbox3 = Listbox(self,height =30, width =25, bg = "beige")
  72.  
  73. listbox3.pack()
  74.  
  75. listbox3.insert(1,"cost of order:")
  76.  
  77. listbox3.place (x=500,y=300)
  78.  
  79. w = Label(self, text="Ez meal APP version 0.00.03", bg="red", fg="white")
  80. w.pack(side= TOP ,fill=X)
  81.  
  82. def OrderAcceptedNotification(self):
  83.  
  84. msg = messagebox.showinfo( "OrderAccepted", "you accepted the last order")
  85.  
  86. def OrderisreadyNotification(self):
  87.  
  88. msg = messagebox.showinfo( "OrderisReady", " You sent order ")
  89.  
  90. def client_exit(self):
  91. exit()
  92.  
  93. root = Tk()
  94.  
  95. root.geometry("1000x1000")
  96.  
  97. app = Window(root)
  98.  
  99. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement