Re: A good menu tutorial?




suchenwi wrote:
Robert Hicks schrieb:

That does what I want it to do, so thanks for that suggestion. What do
those cascade names become assuming the foreach brings back directory
names of dir1, dir2, dir3. Do they become: .m.mLessons.dir1
.m.mLessons.dir2 and .m.mLessons.dir3

Hmm..
Tcl/Tk is very simple. But some reading man pages (in this case, menu)
still helps.

As my (maybe too brief) explanation showed, to add a cascade you'd best
specify a new menu. How to call this is up to you - just make sure its
name doesn't start with an uppercase letter (that's why I put a "m" in
front).

You can call [glob] separately for subdirectories (-type d) and files
(-type f). I'd suggest first to do the directories, create a cascade
for each,

.m.whatever.m$dir create cascade -label $subdir -menu [menu
.m.whatever.m$dir.m$subdir]

and recurse into them (call the same procedure for each again). Then do
the files, adding a simple command to the current menu.

Thank you very much!

Robert

.



Relevant Pages

  • Re: A good menu tutorial?
    ... those cascade names become assuming the foreach brings back directory ... Tcl/Tk is very simple. ... But some reading man pages ... As my explanation showed, to add a cascade you'd best ...
    (comp.lang.tcl)
  • Re: A good menu tutorial?
    ... Tcl/Tk is very simple. ... But some reading man pages ... As my explanation showed, to add a cascade you'd best ... is the widget seperator. ...
    (comp.lang.tcl)
  • Re: Problem with TkMenu::add_cascade
    ... That is NOT a bug of Ruby/Tk. ... Tcl/Tk will give you a same result. ... Please try to make the cascade menu as a daughter of the menu ...
    (comp.lang.ruby)
  • Re: A good menu tutorial?
    ... suchenwi wrote: ... For each item in the top menu, create a cascaded submenu, e.g. ... In your case, add a cascade for each directory, and a command for each ... those cascade names become assuming the foreach brings back directory ...
    (comp.lang.tcl)