Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. #!/usr/bin/python
  2. #!/home/lubuntu/subscription_app
  3.  
  4. from Tkinter import *
  5. from ttk import *
  6. #from subscription_app.enter import *
  7. import tkFileDialog
  8.  
  9.  
  10. window = Tk()
  11. window.configure(bg='lightgrey')
  12. window.title("Odsgsdgsy")
  13. ## resize screen ##
  14. w = 600
  15. h = 500
  16. sw = window.winfo_screenwidth()
  17. sh = window.winfo_screenheight()
  18. x = (sw - w)/2
  19. y = (sh - h)/2
  20. window.geometry('%dx%d+%d+%d' % (w, h, x, y))
  21. ## text above boxes ##
  22. lbl1 = Label(window, text="Members List:")
  23. lbl2 = Label(window, text="Member Information:")
  24. lbl1.grid(row=0, column=0, sticky=W)
  25. lbl2.grid(row=0, column=1, sticky=W)
  26. ## boxes resize with screen ##
  27. frm = Frame(window)
  28. frm.grid(row=1, column=0, sticky=N+S)
  29. window.rowconfigure(1, weight=1)
  30. window.columnconfigure(1, weight=1)
  31. ## member list box with scroll ##
  32. scrollbar = Scrollbar(frm, orient="vertical")
  33. scrollbar.pack(side=RIGHT, fill=Y)
  34. listNodes = Listbox(frm, width=20, yscrollcommand=scrollbar.set, font=("Helvetica", 12))
  35. listNodes.pack(expand=True, fill=Y)
  36. scrollbar.config(command=listNodes.yview)
  37. ## member details box ##
  38. listSelection = Listbox(window, height=4, font=("Helvetica", 12))
  39. listSelection.grid(row=1, column=1, sticky=E+W+N)
  40. ## all buttons ##
  41. saveButton = Button(window, text="Save member details") ##, command=)
  42. saveButton.grid(row=1, column=1, sticky=W)
  43. addButton = Button(window, text="Add member")
  44. addButton.grid(row=2, column=0, sticky=W, pady=10)
  45. deleteButton = Button(window, text="delete member")
  46. deleteButton.grid(row=2, column=0, pady=10)
  47. ## status bar ##
  48. status = Label(window, text="preparing to do nothing", relief=SUNKEN, anchor=S)
  49. status.grid(sticky=W+E, columnspan=2)
  50. ## menu bar ##
  51. menubar = Menu(window)
  52. window.config(menu=menubar)
  53. fileMenu = Menu(menubar)
  54. menubar.add_cascade(label="File", menu=fileMenu)
  55. fileMenu.add_command(label="???")#command=)
  56. fileMenu.add_separator()
  57. fileMenu.add_command(label="Exit") #command=window.onExit)
  58. # def onExit(self):
  59. # self.quit()
  60.  
  61.  
  62. for x in range(100):
  63. listNodes.insert(END, x)
  64.  
  65. for x in "ABCD":
  66. listSelection.insert(END, x + ": ?")
  67.  
  68. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement