Python tkinter treeview update values4/10/2024 ![]() Self.new_contact_button.pack(side=LEFT, padx=10, pady=10) ![]() Self.new_contact_button = Button(ntact_tab.tab, text=(self.new_contact_button_name), command=self.new_contact_window) ![]() ntact_tab.populate_tab_tree(tab_name, column_names) Self.new_contact_button_name = new_contact_button_name Self.tab_tree.insert(parent='', index='end', iid=count, text='', values=row)ĭef _init_ (self, tab_name, new_contact_button_name, column_names): Self.tab_lumn(name, minwidth=25, width=50)ĭef populate_tab_tree(self, table, columns):Ĭonn = nnect('Bookkeeping_Database.sqlite3')Ĭur.execute("CREATE TABLE IF NOT EXISTS " + self.table + " (" + " TEXT, ".join(lumns) +" TEXT)")Ĭur.execute("SELECT * FROM " + self.table) Self.tab_tree.pack(fill="both", expand=YES) Self.tab_tree = Treeview(eeview_frame, yscrollcommand=ee_t, selectmode="extended") Methods allow to add a Treeview, populate treeview # Notebook.pack(fill="both", expand=1, pady=15) Update treeview when new contact added to databaseĮdit contact in database (select record, insert into entry box) I've also tried pasting the code into the end of my on_save_button method.Ĭan anyone point me in the right direction please. I can't even begin to explain what I've tried so far but it's mostly based around trying to re-run def populate_tab_tree from the end of def on_save_button. I've been trying all day to make it so when I add a row to the database that the treeview instantly updates. I've got a treeview widget that is supplied data from an sql database.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |