I was using the code posted in answer here Switch between two frames in tkinter
by @Bryan Oakley. Now I want to add some menu bar. In Pageone I want to add menus File
and Help
and in Pagetwo I want to add menus Data
and plot
But I cant get it done.
I can add menus to to the main window. But then it is available to all the pages and doesn't go away when I change the page. I don't want that. I want to add menubar specific to that page. How can I do that
EDIT
Actually what i want to do that is that, I am making a GUI where you can do mathematical integration and matrix calculation and so on. So on opening the GUI there will be window with buttons for Integration, matrix etc. And clicking on those will open a window where you can do corresponding calculation. I did it using the Toplevel()
command which opens up a new window and I just hide the previous. But I liked GUI code posted by Bryan in that link, so I asked about adding menu to individual pages.
In the Bryan's code I just added these lines `class SampleApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
menu=tk.Menu(self)
self.config(menu=menu)
subMenu=tk.Menu(menu)
menu.add_cascade(label="File",menu=subMenu)`
But as I said it attach the menu to the main window. But I want different menu for different pages.