title: How to update listbox when I change view in Tkinter?
body: <p>I need to update listbox when I'm changing view, but I dont know how to do it. On first page I'm adding some items to list and on second it should to show all items in listbox.</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  from tkinter import *
  
  
  tb1 = [["Kofola", "0,5","30"]]
  
  
  class SeaofBTCapp(Tk):
  
      def __init__(self, *args, **kwargs):
  
          Tk.__init__(self, *args, **kwargs)
          container = Frame(self)
  
          container.pack(side="top", fill="both", expand = True)
  
          container.grid_rowconfigure(0, weight=1)
          container.grid_columnconfigure(0, weight=1)
  
          self.frames = {}
  
          for F in (StartPage, PageOne):
  
              frame = F(container, self)
  
              self.frames[F] = frame
  
              frame.grid(row=0, column=0, sticky="nsew")
  
          self.show_frame(StartPage)
  
      def show_frame(self, cont):
  
          frame = self.frames[cont]
          frame.tkraise()
  
  
  class StartPage(Frame):
  
      def __init__(self, parent, controller):
          Frame.__init__(self,parent)
          label = Label(self, text="Start Page")
          label.pack(pady=10,padx=10)
  
          button = Button(self, text="Visit Page 1",
                              command=lambda: controller.show_frame(PageOne))
          button.pack()
  
          button2 = Button(self, text="add",
                              command=self.add)
          button2.pack()
  
      def add(self):
          tb1.append(["Radegast", "0,5","30"])
          print(tb1)
  
  
  
  class PageOne(Frame):
  
      def __init__(self, parent, controller):
          Frame.__init__(self, parent)
          label = Label(self, text="Page One!!!")
          label.pack(pady=10,padx=10)
  
          button1 = Button(self, text="Back to Home",
                              command=lambda: controller.show_frame(StartPage))
          button1.pack()
  
          self.bill=Listbox(self)
          self.bill.pack()
  
  
  
          for item in tb1:
              co=" ".join(str(x) for x in item)
              self.bill.insert(END, co)
  
  app = SeaofBTCapp()
  app.mainloop()
  </code></pre>