Jan-30-2024, 07:21 PM
(This post was last modified: Jan-30-2024, 07:22 PM by jacksfrustration.)
hello
i am writing a workout tracker app. i have the option of adding rows of information to save multiple workout data at the same time. i accomplish that with the following code
i am writing a workout tracker app. i have the option of adding rows of information to save multiple workout data at the same time. i accomplish that with the following code
globals()[f'day_lbl{self.count}'] = Label(text="On") globals()[f"day_value_inside{self.count}"] = StringVar(window, value=self.day_value_inside0.get()) globals()[f"day_opt{self.count}"] = OptionMenu(window, globals()[f"day_value_inside{self.count}"], self.updated_list[0], self.updated_list[1], self.updated_list[2], self.updated_list[3], self.updated_list[4],self.updated_list[5],self.updated_list[6],self.updated_list[7],self.updated_list[8],self.updated_list[9],self.updated_list[10]) globals()[f"day_opt{self.count}"].grid(row=self.cur_row, column=1) globals()[f'lbl{self.count}'] = Label(text="I did") globals()[f"lbl{self.count}"].grid(row=self.cur_row, column=2) globals()[f"act_value_inside{self.count}"] = StringVar(window, value="Aerobics") globals()[f"act_opt{self.count}"] = OptionMenu(window, globals()[f"act_value_inside{self.count}"], "Aerobics", "Cycling", "Running", "Swimming", "Walking") globals()[f"act_opt{self.count}"].grid(row=self.cur_row, column=3) globals()[f"unit_lbl{self.count}"] = Label(text="for: ") globals()[f"unit_lbl{self.count}"].grid(row=self.cur_row, column=4) globals()[f"unit_ent{self.count}"] = Entry() globals()[f"unit_ent{self.count}"].grid(row=self.cur_row, column=5) globals()[f"min_lbl{self.count}"] = Label(text="minutes") globals()[f"min_lbl{self.count}"].grid(row=self.cur_row, column=6)i want to add the option to get rid of a row of data. as you can see i use the .grid function to place the widgets according to my design. is there a way of removing either the selected row of data or the last one?