Guest User

Untitled

a guest
Dec 3rd, 2019
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##########file main.py
  2.  
  3. def create_services_treeview(parent):
  4. global tree_frame, tree
  5. tree_frame = Frame(parent, bg=inner_background)
  6. tree_frame.pack(side=TOP)
  7. scrollbar = Scrollbar(tree_frame)
  8. scrollbar.pack(side=RIGHT, fill=Y)
  9. tree = ttk.Treeview(tree_frame, height=10, yscrollcommand=scrollbar.set)
  10. tree.config(selectmode='browse')
  11. tree['columns'] = ('1', '2', '3')
  12. tree['show'] = 'headings'
  13. tree.column('1', width=50, anchor=W)
  14. tree.column('2', width=600, anchor=W)
  15. tree.column('3', width=70, anchor=W)
  16. tree.heading('1', text='id')
  17. tree.heading('2', text='Name')
  18. tree.heading('3', text='Cost')
  19. tree.pack(side=TOP)
  20. scrollbar.config(command=tree.yview)
  21. mc.set_services_treeview(tree)
  22.  
  23.  
  24. ##########file mc.py
  25.  
  26. def set_services_treeview(treeview):
  27. services = Services().get_text()
  28. services_list = []
  29. for service in services:
  30. treeview.insert('', 'end', values=(service[0], service[1], service[2]))
RAW Paste Data