title: Tkinter python dependent combobox
body: <p>I am a python and arcpy user and I have a problem about dependent combobox. Actually I have asked the same topic on <a href="https://stackoverflow.com/questions/40504864/graded-combobox-menu-python-tkinter">here</a>, but no one answer yet. I've got the answer from <a href="https://gis.stackexchange.com/questions/154957/dependent-comboboxes-in-qgis-2-8-2">here</a> and <a href="https://stackoverflow.com/questions/13502710/pyqt4-combobox-changes-the-list-of-another-combobox">here</a>. But I think I am too newbie on python programming and I don't get the answer clearly.
  I try my code like this below, base on the answer that I've got before:</p>
  
  <pre><code>import Tkinter
  from Tkinter import *
  
  root = Tkinter.Tk()
  
  bu = StringVar()
  bu.set("")
  businessunit = ["DUM", "IND", "KAM", "RAP"]
  bu_menu = OptionMenu(root, bu, *businessunit, command=Combobox_1)
  bu_menu.config(bg="white", fg="dark blue", width=3, relief=GROOVE)
  bu_menu.place(x=95, y=110)
  
  sec = StringVar()
  sec.set("")
  sector = {"DUM":['GRG', 'KBU', 'LBO', 'PLS', 'PLU', 'PPR', 'RPT', 'SBI', 'SKB'],
                  "IND":['BYS','MER','NGD','PER','SJG','SLJ'],
                  "KAM":['RSG','SRG','SRY','TSK'],
                  "RAP":['BAS','CER','LGB','LON','LOS','MDU','MRE','MRW','PEN','PES','PPD','TEE','TEW','TSB','UKU']}
  sec_menu = OptionMenu(root, sec, *sector, command=Combobox_2)
  sec_menu.config(bg="white", fg="dark blue", width=3, relief=GROOVE)
  sec_menu.place(x=155, y=110)
  
  def __init__(self):
  
      def Combobox_1(businessunit):
          print bu.get()
  
      def Combobox_2(sector):
          print sec.get()
  
      self.Combobox_1.activated[str].connect(self.on_combo_activated)
  
  def on_combo_activated(self, text):
      self.Combobox_2.clear()
      self.Combobox_2.addItems(self.sector[text])
  
  root.pack()
  root.mainloop()
  root.destroy()
  </code></pre>
  
  <p>Please anyone help me on this. Thank you so much for your answer.</p>
  
  <p><strong>edited:</strong></p>
  
  <p>in this case, dependent combobox means:</p>
  
  <p>If DUM is selected in Combobox_1, Combobox_2 will only show GRG,KBU,LBO, etc.</p>
  
  <p>If IND is selected in Combobox_1, Combobox_2 will only show BYS,MER,PER, etc.</p>
  
  <p>If KAM is selected in Combobox_1, Combobox_2 will only show RSG,SRG,SRY, etc.</p>
  
  <p>If RAP is selected in Combobox_1, Combobox_2 will only show BAS,CER,LGB, etc.</p>