1,105,290 Community Members

Cascaded menu-help

Member Avatar
python_user
Light Poster
34 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Can anyone please help me as i am new to python, i have a requirement for a cascaded menu(which should be dynamically built).

The cascaded menu should have new at all levels and when the user clicks on new it should ask for keyword and when done it should add that as a menu item and it should rebuild the cascaded menu with that new thing included. So the user should be allowed to build his own cascaded menu hierarchy.
If any body has any ideas, please help me.

Thanks in advance ...

Member Avatar
SgtMe
Nearly a Posting Virtuoso
1,204 posts since Oct 2009
Reputation Points: 46 [?]
Q&As Helped to Solve: 86 [?]
Skill Endorsements: 0 [?]
Featured
 
0
 

So your looking at GUI's? Tkinter would be your best bet. Look up how to create cascading menu's. I have a couple of youtube videos on them as well.
Just apply your own logic for how to create them from user input. It should be fairly simple.

Text documentation/tutorial:
http://www.pythonware.com/library/tkinter/introduction/x5819-patterns.htm
My videos:
http://www.youtube.com/watch?v=AxFOIaFYJq4
(You would probably only need the first one)
http://www.youtube.com/watch?v=EP1uxP2RPwc


Please upvote if this helped :)

Member Avatar
python_user
Light Poster
34 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thank you for ur reply...
i know how to create cascaded menus, but what i want is the ability for user interaction to add new menu items at each level, Can any one please help me...

Member Avatar
SgtMe
Nearly a Posting Virtuoso
1,204 posts since Oct 2009
Reputation Points: 46 [?]
Q&As Helped to Solve: 86 [?]
Skill Endorsements: 0 [?]
Featured
 
0
 

OK here goes:
Start by making the base of your toolbar, without any dropdown bits in it. You will need a loop. At the top of the loop, you ask for the user to input a string. This string will be the label for a new button on the menu. Then, create a the item on the menu in the same base toolbar you made earlier, with the label being the string the user put in. You just need to pass variables to the statements that create the menu item.

Member Avatar
richieking
Posting Shark
926 posts since Jun 2009
Reputation Points: 40 [?]
Q&As Helped to Solve: 171 [?]
Skill Endorsements: 3 [?]
 
0
 

having a while loop besides the main loop in a GUI is not advisable as it can cause a freeze.

Why not simply have use to menu event tool to update the casscading menu and increase by foo += 1 or foo -=1. Push the newly created into list/dict or even a conf file and update from the list/dic/file inside the menu event method....
That is my take

;)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article