title: Change dataframe displayed in pandastable (tkinter widget)
body: <p>I am currently working on a GUI that displays pandas dataframes.</p>
  
  <p>I want an <code>OptionMenu</code> to select the dataframe from a list and then display it in the pandastable.</p>
  
  <p>My current approach: I have an attribute curTable in my class and I initially fill it with the first dataframe, which is correctly displayed in the pandastable. Then when the value of my <code>StringVar</code> connected to my <code>OptionMenu</code> changes I call a callback function that changes the attribute and redraw the pandastable.</p>
  
  <pre><code>import tkinter as tk
  from pandastable import Table, TableModel
  import pandas as pd
  
      class test_gui():
  
          def __init__(self):
              self.root = tk.Tk()
              LF3 = tk.LabelFrame(self.root, text='Output')
              LF3.grid(column=2, row=0, padx=(4,4), pady=4, sticky="nsew")  
  
              def tableSelChange(*args):
                  df1 = pd.DataFrame([[1,2,3],['what', 'is', 'this'],[123, 123, 123]], 
                                     columns=['This', 'is', 'a Test'])
                  df2 = pd.DataFrame([['bruh', 'this', 'is a gui'],[1235, 1235, 1235],[123, 123, 123]], 
                                      columns=['This', 'is', 'a Test2'])
  
                  if tableSelVar.get() == 'One':
                      print('ONE')
                      self.curTable = df1
                  elif tableSelVar.get() == 'Two':
                      print('Two')
                      self.curTable = df2
                  #self.dfTbl.redraw()
                  #dfTbl.tableChanged()
                  dfTbl.redraw()
  
              tableSelVar = tk.StringVar(LF3)
              tableSelVar.set('No tables available')
  
              tableSelMenu = tk.OptionMenu(LF3, tableSelVar, 'One', 'Two')
              tableSelMenu.pack()
  
              df1 = pd.DataFrame([[1,2,3],['what', 'is', 'this'],[123, 123, 123]], 
                                 columns=['This', 'is', 'a Test'])
              df2 = pd.DataFrame([['bruh', 'this', 'is a gui'],[1235, 1235, 1235],[123, 123, 123]], 
                                  columns=['This', 'is', 'a Test2'])
  
              self.curTable = df1
  
              LLF31 = tk.LabelFrame(LF3, text='Table editor')
              LLF31.pack()
              dfTbl = Table(LLF31, dataframe=self.curTable, showtoolbar=True, showstatusbar=True)
              dfTbl.show()
  
              tableSelVar.trace('w', tableSelChange)
  
              self.root.mainloop()
  
      if __name__ == '__main__':
          t = test_gui()
  </code></pre>
  
  <p>When I select the second dataframe, the pandastable does not change. How can I achieve this?</p>