title: Python tkinter widget resizes when it changes
body: <p>How can I prevent the widgets in this app from changing size when I press the toggle headings button? </p>
  
  <p>I would like the two Treeviews to always take up 50% of the width of the window each</p>
  
  <p>Currently the left one resizes when it gets more/less columns</p>
  
  <pre><code>import tkinter as tk
  from tkinter import ttk
  def toggle_headings():
      global htog
      if htog==0:
          t1.config(columns=columnswide)
          for i,h in enumerate(columnswide):
              c = ('#')+str(i)
              t1.heading(c,text=h)
          htog = 1
      else:
          t1.config(columns=columns)
          t1.heading(columns[0],text=columns[0])
          htog = 0
  htog = 0
  
  app = tk.Tk()
  
  columnswide = ['abcd' for i in range(5)]
  columns = ['abcd']
  columnsbutton = tk.Button(app,text='toggle headings',command=toggle_headings)
  
  t1 = ttk.Treeview(app,selectmode='browse',columns=columns)
  t2 = ttk.Treeview(app,selectmode='browse',columns=columnswide)
  for i,h in enumerate(columnswide):
      c = ('#')+str(i)
      t2.heading(c,text=h)
  t1.heading(columns[0],text=columns[0])
  for i in range(10):
      t1.insert('','end',text='testing '+str(i),values=['value'])
      t2.insert('','end',text='testing '+str(i),values=['value' for i in range(5)])
  
  columnsbutton.pack(side='top',fill='x',expand=1)
  t1.pack(side='left',fill='both',expand=1)
  t2.pack(side='left',fill='both',expand=1)
  
  app.mainloop()
  </code></pre>
  
  <p>In case anyone suggests using .grid(), I have tried this method below:</p>
  
  <pre><code>import tkinter as tk
  from tkinter import ttk
  def toggle_headings():
      global htog
      if htog==0:
          t1.config(columns=columnswide)
          for i,h in enumerate(columnswide):
              c = ('#')+str(i)
              t1.heading(c,text=h)
          htog = 1
      else:
          t1.config(columns=columns)
          t1.heading(columns[0],text=columns[0])
          htog = 0
  htog = 0
  
  app = tk.Tk()
  
  columnswide = ['abcd' for i in range(5)]
  columns = ['abcd']
  columnsbutton = tk.Button(app,text='toggle headings',command=toggle_headings)
  
  t1 = ttk.Treeview(app,selectmode='browse',columns=columns)
  t2 = ttk.Treeview(app,selectmode='browse',columns=columnswide)
  for i,h in enumerate(columnswide):
      c = ('#')+str(i)
      t2.heading(c,text=h)
  t1.heading(columns[0],text=columns[0])
  for i in range(10):
      t1.insert('','end',text='testing '+str(i),values=['value'])
      t2.insert('','end',text='testing '+str(i),values=['value' for i in range(5)])
  
  columnsbutton.grid(row=0,column=0,columnspan=2,sticky='we')
  t1.grid(row=1,column=0,sticky='nswe')
  t2.grid(row=1,column=1,sticky='nswe')
  app.grid_columnconfigure(0,weight=1)
  app.grid_columnconfigure(1,weight=1)
  app.mainloop()
  </code></pre>