Re: A good menu tutorial?
- From: "Robert Hicks" <sigzero@xxxxxxxxx>
- Date: 30 Aug 2006 09:53:33 -0700
suchenwi wrote:
Robert Hicks schrieb:
So I guess I can do a foreach on "$home/Courses/" to get the dir names
and file names? I am not sure how to build a menu with that though.
Anyone done something like this?
From http://en.wikibooks.org/wiki/Programming:Tcl_Tk#menu
To add a menu to a GUI application, take steps of three kinds:
Create the toplevel horizontal menu (needed only once):
. configure -menu [menu .m]
For each item in the top menu, create a cascaded submenu, e.g.
.m add cascade -label File -menu [menu .m.mFile]
For each entry in a submenu, add it like this:
.m.mFile add command -label Open -command {openFile ...}
or
.m.mFile add separator
In your case, add a cascade for each directory, and a command for each
file that [glob] brings you.
Great! I did it and it works. : D
Robert
.
- Follow-Ups:
- Re: A good menu tutorial?
- From: suchenwi
- Re: A good menu tutorial?
- References:
- A good menu tutorial?
- From: Robert Hicks
- Re: A good menu tutorial?
- From: suchenwi
- A good menu tutorial?
- Prev by Date: Re: A good menu tutorial?
- Next by Date: Re: Twapi get primary domain controller
- Previous by thread: Re: A good menu tutorial?
- Next by thread: Re: A good menu tutorial?
- Index(es):