Jun-06-2019, 01:26 AM
In my GUI using tkinter, I'm trying to update the value display for option menu based on selected row function.
Appreciate if someone can give a though on how to do this.
Both backed & front end files attached. Sample database can't be attached. So pls. input some sample data and add data to create a sqlite database.
def get_selected_row(event): try: global selected_tuple index=list1.curselection()[0] selected_tuple=list1.get(index) e1.delete(0,END) e1.insert(END,selected_tuple[1]) e2.delete(0,END) e2.insert(END,selected_tuple[2]) e3.delete(0,END) e3.insert(END,selected_tuple[3]) e4.delete(0,END) e4.insert(END,selected_tuple[4]) #avial_typeSelect_text.setvar(textvar,selected_tuple[5]) #avial_typeSelect_text.update() avial_typeSelect_text['menu'].delete(0,END) #avial_typeSelect_text['menu'].add_command( command=tk._setit(avial_text, selected_tuple[5])) avial_typeSelect_text['menu'].update(END,selected_tuple[5]) print(selected_tuple[5]) except IndexError: passHowever this was not successful.In the attached picture shows that value of the filed "Availability" is "No" in the database. But value shows in the option menu is not updated according to selected row.
Appreciate if someone can give a though on how to do this.
Both backed & front end files attached. Sample database can't be attached. So pls. input some sample data and add data to create a sqlite database.
Attached Files
Thumbnail(s)