Thank you for replying.
It seems difficult for me! but would that mean in my request_details method I would also need to to start building a dictionary... the key being the detail_name that I send from the customer_tab function and the value being from a .get()?
Right now, I think I need to start again.
Is using a class the best way to go about this? So far, I don't quite see the point in using classes. It feels like it's a good way to build a tab but I'm struggling to do much with it once it's set out.
To make it easier for me to read I've removed the sql stuff.
It seems difficult for me! but would that mean in my request_details method I would also need to to start building a dictionary... the key being the detail_name that I send from the customer_tab function and the value being from a .get()?
Right now, I think I need to start again.
Is using a class the best way to go about this? So far, I don't quite see the point in using classes. It feels like it's a good way to build a tab but I'm struggling to do much with it once it's set out.
To make it easier for me to read I've removed the sql stuff.
from tkinter import * from tkinter.ttk import * import sqlite3 ### Create tkinter window ### root = Tk() root.title("Bookkeeping") root.geometry("800x600") ### Add a Notebook to window ### home_screen = Notebook(root) home_screen.pack(fill="both", expand=1, pady=15) ### Class to add tabs to Notebook with a method to add entry boxes and a save button ### class Create_tab: def __init__(self, tab): tab_name = str(tab) self.tab = tab self.tab = Frame(home_screen) self.tab.pack(fill="both", expand=1) home_screen.add(self.tab, text=tab_name) def request_details(self, detail_name): entry_box = Entry(self.tab) entry_box.grid(column=1) entry_box.insert(0, detail_name) def save_button(self): save_button = Button(self.tab, text="Save") save_button.grid(column=1) ### Create Customers tab ### def customer_tab(): customer_tab = Create_tab("Customers") entry_boxes = ["Customer ID","Name","Address 1","Address 2","Address 3","Address 4", "Email Address", "Phone 1", "Phone 2"] for detail_name in entry_boxes: customer_details = customer_tab.request_details(detail_name) save_button = customer_tab.save_button() ### Create Vendors tab ### def vendor_tab(): vendor_tab = Create_tab("Vendors") for detail_name in ["Name","Address 1","Address 2","Address 3","Address 4", "Email Address", "Phone 1", "Phone 2"]: vendor_details = vendor_tab.request_details(detail_name) #Main customer_tab() vendor_tab() root.mainloop()