title: Dynamically update Tkinter ComboBox from an empty list
body: <p>I'm struggling to find a solution to this tkinter application I'm trying to build.</p>
  <p>What I'm trying to build is a tool to pull out sheets and headers for an excel file. I want to enable the user to select the sheet and headers they want to pull from.</p>
  <pre><code>class myApp:
  importedSheets = []
  us_sheets = None
  headers = []
  us_headers = None
  
  def UploadAction(self):
      self.filename = askopenfilename()
      print(self.filename)
  
  def sheetnames(self):
      global importedSheets
      self.xlssheets = xlrd.open_workbook(self.filename,on_demand=True)
      importedSheets = self.xlssheets.sheet_names()
      #print (importedSheets)
      return importedSheets
  </code></pre>
  <p>I'm able to have the user select the file they want to pull information from, and populate the empty list importedSheets = [ ] with the correct sheet names.</p>
  <p>What I can't seem to find out is how to display this list on a Tkinter Combobox. Everytime I try it, it just shows a blank combobox.</p>
  <pre><code>    def __init__(self,master):
         self.filename = None
         self.master = master
         self.cbox_sheets = Combobox(master = master,values = myApp.importedSheets,postcommand = self.sheetnames).pack()
  </code></pre>
  <hr />
  <pre><code>import pandas as pd
  import os
  import xlrd
  from tkinter import *
  from tkinter.filedialog import askopenfilename
  from tkinter.ttk import Combobox
  import tkinter as tk
  import re
  import numpy as np
  
  class myApp:
      importedSheets = []
      us_sheets = None
      headers = []
      us_headers = None
      
      def UploadAction(self):
          self.filename = askopenfilename()
          print(self.filename)
      
      def sheetnames(self):
          global importedSheets
          self.xlssheets = xlrd.open_workbook(self.filename,on_demand=True)
          importedSheets = self.xlssheets.sheet_names()
          #print (importedSheets)
          return importedSheets
          
      def showsheets(self):
          return myApp.importedSheets()
      
      def __init__(self,master):
          self.filename = None
          self.master = master
      
          self.frame1 = Frame(master=master,relief=RAISED,borderwidth=1)
          self.frame1.pack(padx=10,pady=10)
          
          self.frame2 = Frame(master=master,relief=RAISED,borderwidth=1)
          self.frame2.pack(padx=10,pady=10)
          
          self.frame3 = Frame(master=master,relief=RAISED,borderwidth=1)
          self.frame3.pack(padx=10,pady=10)
          
          self.frame2a = Frame(master = self.frame2)
          self.frame2b = Frame(master = self.frame2)
          self.frame2r = Frame(master = self.frame2)
          self.frame2a.pack(side=TOP)
          self.frame2b.pack(side=LEFT)
          self.frame2r.pack(side=RIGHT)
          
          self.uploadLabel = Label(master = self.frame2a,text = 'Select the file you want to import',font=(None,12)).pack()
          self.uploadButton = Button(master = self.frame2a,text = 'Import',command = lambda:self.UploadAction()).pack()
         
          self.sheetLabel = Label(master = self.frame2b,text = 'Select the sheet to extract',font=(None,12)).pack(padx=15)
          
          self.cbox_sheets = Combobox(master = self.frame2b,values = myApp.importedSheets,postcommand = self.sheetnames).pack()
         
          self.headerLabel = Label(master = self.frame2r,text = 'Select the header with data',font=(None,12)).pack(padx=15)
          
          
  if __name__ == '__main__':
      root = Tk()
      my_gui = myApp(root)
      root.mainloop()
  </code></pre>