We are trying to make a simple GUI for our HR department. We are using tkinter with PyAD and subprocess. I am trying to create a dynamic OptionMenu based on a "selection" in the previous OptionMenu.
For example: "Department" OptionMenu {"Warehouse", "Office", "Shipping"} >>> The "Job" OptionMenu would change accordingly "Warehouse" is selected "Job" OptionMenu would show {"Pallet Jack", "High Lift", "Stand Up"}.
I have hard coded the warehouse positions due to that department having the most hires.
depts = { 'Warehouse','Office','HR','IT','Maintenance'}
dept_var.set('DEPT') # set the default option
jobs = {'Pallet Jack', 'General Labor', 'Sit Down', 'Stand Up', 'Highlift'}
job_var.set('JOB')
popupMenu1 = OptionMenu(mainframe, dept_var, *depts)
popupMenu1.grid(row = 2, column =1)
popupMenu2 = OptionMenu(backframe, job_var, *jobs)
popupMenu2.grid(row = 2, column =1)