Question

I current am making a GUI using tk, I have implemented a ttk notebook to have two separate tabs, each of these tabs hold data but call the same functions to interact with this data, is that a sane way to do this? Or should I just make more functions to call them separately? They need to know which tab is currently selected.

Thanks.

Was it helpful?

Solution

okay, this might not be the best way, but for each widget in the tabs, pass through a variable in the functions which will then be used in an if statement to check which tab is currently selected, as you're only using two this could be Boolean? if more is needed more complex step will be needed, but that is a simple way to do this, but not pretty :p
xx

OTHER TIPS

Here's a link to show you how to perform this, hope it helps =]

Tkinter Notebook Demo

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top