943,192 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 963
  • Python RSS
Mar 9th, 2010
0

Cascade Menu need help

Expand Post »
hello
I was just wondering if anyone knows of a site or someone (or start me off with some code) that could help me with learning about cascade menu's and changing them from a parent into a child, any help would be greatly appreciated. I am making the cascade menu in Tkinter btw. Also this is only meant to be a simple screen shot so the code does not have to be completly working, i am just mainly focused apon learning to change code between a parent and child.

RC
Last edited by ChargrO; Mar 9th, 2010 at 10:29 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ChargrO is offline Offline
17 posts
since Mar 2010
Mar 10th, 2010
0
Re: Cascade Menu need help
Well I'm actually doing some tutorials on Youtube ATM, covering lots of stuff in Tkinter. I did a vid on cascade menus but I didn't cover parent to child.

Anyway here is a link to my vids:
http://www.youtube.com/pyProgrammer96
Featured Poster
Reputation Points: 68
Solved Threads: 85
Veteran Poster
SgtMe is offline Offline
1,188 posts
since Oct 2009
Mar 16th, 2010
0
Re: Cascade Menu need help
So ive got my cascade window down to a simple definition which pops down inside a master window

Python Syntax (Toggle Plain Text)
  1. from Tkinter import *
  2.  
  3. class Application(Frame):
  4. def __init__(self, master=None):
  5. self.master = master=None
  6. self.menubar = Menu(self.master)
  7. Frame.__init__(self)
  8. self.createMenu()
  9.  
  10. def createMenu(self):
  11. self.mb = Menubutton ( self, text='FOOD MENU',
  12. relief=FLAT, font=('Arial', 20))
  13. top=self.winfo_toplevel()
  14. top.rowconfigure(6,weight=1)
  15. top.columnconfigure(0, weight=1)
  16. self.rowconfigure(6, weight=1)
  17. self.columnconfigure(0, weight=1)
  18. self.mb.grid(row=6, column=0)
  19.  
  20. self.mb.menu = Menu (self.mb, tearoff=0)
  21. self.mb['menu'] = self.mb.menu
  22.  
  23. Meat = self.mb.menu.add_cascade ( label='Meat')
  24. self.mb.menu.add_cascade ( label='Steak')
  25.  
  26. Seafood = self.mb.menu.add_cascade ( label='Seafood')
  27.  
  28. Pasta = self.mb.menu.add_cascade ( label='Pasta')
  29.  
  30. Vegitarian = self.mb.menu.add_cascade ( label='Vegitarian')
  31.  
  32. Desserts = self.mb.menu.add_cascade ( label='Desserts')
  33.  
  34. Beverages = self.mb.menu.add_cascade ( label='Beverages')
  35.  
  36. app = Application()
  37. app.master.title("Major Project Sample Screen")
  38. app.mainloop()


So this should create my window and a pop down button with different options, i woul like to know if it is possible how to make it pop out again with different option

Cheers
RC
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ChargrO is offline Offline
17 posts
since Mar 2010
Mar 16th, 2010
0
Re: Cascade Menu need help
i think you like need to put in...

Python Syntax (Toggle Plain Text)
  1. self.steakVar = IntVar()
  2. self.mb.menu.add_command(label="Blah Blah Blah", command=self.pop up another window)

below each option
but obviously change the name of the thing
Reputation Points: 6
Solved Threads: 2
Light Poster
pythonNerd159 is offline Offline
30 posts
since Mar 2010
Mar 22nd, 2010
0
Re: Cascade Menu need help
How would i implement the below code into my def function??
Python Syntax (Toggle Plain Text)
  1. self.steakVar = IntVar()
  2. self.mb.menu.add_command(label="Blah Blah Blah", command=self.pop up another window)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ChargrO is offline Offline
17 posts
since Mar 2010
Mar 22nd, 2010
-2
Re: Cascade Menu need help
yeah i think you do. put it in the same column as the other code.

Reputation Points: 6
Solved Threads: 2
Light Poster
pythonNerd159 is offline Offline
30 posts
since Mar 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Is my output correct?
Next Thread in Python Forum Timeline: Help with python programming





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC