So basically I have 2 frames, UploadPage and PageOne:
class UploadPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self,parent)
self.controller = controller
theLabel = tk.Label(self, text='Upload your CSV here.', padx=10, pady=10)
theButton = tk.Button(self, text='Browse', command=open_file)
fileLabel = tk.Label(self, padx=10, pady=10)
submitButton = tk.Button(self, text='Submit', command= lambda: controller.show_frame(PageOne))
filePathLabel = tk.Label(self) #hidden label used to store file path
theLabel.grid(row=0)
theButton.grid(row=1, column=0)
fileLabel.grid(row=1, column=1)
submitButton.grid(row=3, column=0)
class PageOne(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
theLabel = tk.Label(self, text='Hi', padx=10, pady=10)
theLabel.pack()
app = SeeAssBeeapp()
app.mainloop()
Say I want to get the text of filePathLabel in UploadPage and display it in PageOne. How do i do that? Thank you!