I have an application that transforms coordinates from one system to another. The source and the target frames use many similar functions like the ones executed when a combobox change.
How to create thes functions once and use them in both frames
Here is an example of these function that is executed when combobox geographic format is modified in the source system. I wrote the same one for the target system
def modified_combo_gf_src(choice):
chaine = chaine2 = chaine3 = ''
if choice == "deg":
chaine = "Latitude φ en °"
chaine2 = "Longitude λ en °"
if choice == "gon":
chaine = "Latitude φ en gon"
chaine2 = "Longitude λ en gon"
if choice == "rad":
chaine = "Latitude φ en rad"
chaine2 = "Longitude λ en rad"
if choice == "dms":
chaine = "Latitude φ en ° ' ""
chaine2 = "Longitude λ en ° ' ""
if choice == "pdms":
chaine = "Latitude φ en pdms"
chaine2 = "Longitude λ en pdms"
lbl_coord_x_src.configure(text=chaine)
lbl_coord_y_src.configure(text=chaine2)
I am expecting to have one function to deal with the equivalent widgets in the source and target tabs.