Advertisement
Guest User

Well Rested

a guest
Jan 23rd, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. from WellRested import * # This imports my WellRested class as well as anything that WellRested imports
  2. # including tkinter so another import statement is not necessary
  3.  
  4. root = Tk() # creating a blank window
  5. interactive = WellRested(root) # Creates a Well Rested object
  6. root.mainloop() # Puts your window in a loop so it can display on the screen
  7.  
  8.  
  9.  
  10. from tkinter import *
  11. import time
  12. import tkinter.messagebox
  13.  
  14. class WellRested:
  15. def __init__(self, master):
  16. frame = Frame(master, width=400, height=400)
  17. frame.pack()
  18. topMenu = Menu(master)
  19. master.config(menu=topMenu)
  20.  
  21. fileMenu = Menu(topMenu)
  22. topMenu.add_cascade(label="File", menu=fileMenu)
  23. fileMenu.add_command(label="New", command=print)
  24. fileMenu.add_command(label="Home", command=print)
  25. fileMenu.add_separator()
  26. fileMenu.add_command(label="Exit", command=master.destroy)
  27.  
  28. windowMenu = Menu(topMenu)
  29. topMenu.add_cascade(label="Window", menu=windowMenu)
  30. windowMenu.add_command(label="Minimize", command=print("Minimize"))
  31.  
  32. helpMenu = Menu(topMenu)
  33. topMenu.add_cascade(label="Help", menu=helpMenu)
  34. helpMenu.add_command(label="Getting Started")
  35.  
  36. timeElapsedLabel = Label(frame, text="Time elapsed in current interval: 0:00:00:00")
  37. timeElapsedLabel.grid(row=0, column=0)
  38. timeRemainingLabel = Label(frame, text="Time remaining in current interval: 0:00:00:00")
  39. timeRemainingLabel.grid(row=1, column=0)
  40. createIntervalButton = Button(frame, text="Create a new rest interval", command=self.createInterval)
  41. createIntervalButton.grid(row=0, column=5)
  42. pauseIntervalButton = Button(frame, text="Pause the current interval")
  43. pauseIntervalButton.grid(row=1, column=5)
  44. resetIntervalButton = Button(frame, text="Reset the current interval")
  45. resetIntervalButton.grid(row=2, column=5)
  46.  
  47. def createInterval(self):
  48. createIntervalFrame = Tk()
  49. promptLabel = Label(createIntervalFrame, text="Please select the type of interval you would like to create")
  50. promptLabel.grid(row=0)
  51. defaultButton = Button(createIntervalFrame, text="Default", command=self.beginDefault and createIntervalFrame.destroy)
  52. defaultButton.grid(row=1, column=0)
  53. customButton = Button(createIntervalFrame, text="Custom", command=self.determineCustom and createIntervalFrame.destroy)
  54. customButton.grid(row=1, column=1)
  55. createIntervalFrame.mainloop()
  56.  
  57. def determineCustom(self):
  58.  
  59. customFrame = Tk()
  60.  
  61. customFrame.mainloop()
  62.  
  63. def beginDefault(self):
  64. initialTime = time.time()
  65. print("Hello World!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement