Menu

#144 tearoff menu add's should return index

open
5
2003-11-12
2003-11-04
No

When I have code like this, I would like to be able to
store the index number of particular options for later use.

menu .mbar
. config -menu .mbar

.mbar add cascade -label "File" -underline 0 \ -menu [menu .mbar.file -tearoff 0]
.mbar add cascade -label "Help" -underline 0 \ -menu [menu .mbar.help -tearoff 0]

set m .mbar.file
$m add command -label "Open Test Suite" -underline 0 \ -command gui::opentestsuite

This simple patch does what I need. There is probably
extra work/thinking to do to make sure that everything
is consistent...

Discussion

  • David N. Welton

    David N. Welton - 2003-11-04
     
  • David N. Welton

    David N. Welton - 2003-11-04
    • labels: --> 10. Generic Menus
     
  • Don Porter

    Don Porter - 2003-11-12
    • assigned_to: nobody --> hobbs
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Seems like a good idea to me (the index won't necessarily be
    valid if you change the -tearoff option or insert new
    entries, but that's easily resolvable using careful
    documentation)

    Needs microTIP.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.