| Description: |
It is quite common today to have additional, short description of chosen buttons/menu entries etc. either on kind of statusbar, or in the "tooltip"-form. Currently such description has to be added using some additional structures, while it can be avoided by having additional option: let's here call it "-description" - which can be then easily called using "cget". That "description" (which itself is a simple text, and nothing more) could even be set in form similar to "-command": using {} dynamically, using "" statically - which will make the ways of assignment even broader.
A short example, how could it look like:
$w.menu add cascade -label "File" -description "File operations menu"
bind Menu <<MenuSelect>> {
global menustatus
if {[catch {%W entrycget active -description} label]} {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
set label " "
}
set menustatus $label
update idletasks
}
Such option could be added to all the "interactive" widgets - those which can be used to run commands, or choose options - of course, it won't be necessarily for "separators" (or can be ignored in such case).
Such way adding/changing "tooltips" (or statusbar texts) contents would be much more easier during both creation and maintenance.
|