-1

I was wondering if anyone knows some siimple code to start me off on making a cascade window??

my current code from my reference book is to confusing for me

from Tkinter import *

class TestMenu:
    def __init__(self, master):
        self.master = master
        self.menubar = Menu(self.master)


        self.casmenu = Menu(self.menubar)
        self.casmenu.choices = Menu(self.casmenu)
        self.casmenu.choices.wierdones = Menu(self.casmenu.choices)
        self.casmenu.choices.wierdones.add_command(label='A')
        self.casmenu.choices.wierdones.add_command(label='B')
        self.casmenu.choices.wierdones.add_command(label='C')
        self.casmenu.choices.wierdones.add_command(label='D')    
        
        self.casmenu.choices.add_command(label='A')
        self.casmenu.choices.add_command(label='B')
        self.casmenu.choices.add_command(label='C')
        self.casmenu.choices.add_command(label='D')
        self.casmenu.choices.add_command(label='E')
        self.casmenu.choices.add_command(label='F')
        self.casmenu.choices.add_cascade(label='G', 
                        menu=self.casmenu.choices.wierdones)

        self.casmenu.add_cascade(label='Scripts',
                                      menu=self.casmenu.choices)

        self.unused = Menu(self.menubar)
        
        self.menubar.add_cascade(label="Cascade Menu", menu=self.casmenu)

        self.top = Toplevel(menu=self.menubar, width=500, relief=RAISED,
                            borderwidth=2)

def main():
    root = Tk()
    root.withdraw()
    app = TestMenu(root)
    root.mainloop()

if __name__ == '__main__':
    main()

does anyone know how i could maybe convert this into a child or just shrink down my code to make is a bit simpler.

RC

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by woooee
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.