#! ../mofe --f
# this small script deomestrates how to provide life buttons: when the
# mouse pointer enters the button, a short help message is displayed.
#
# Gustaf Neumann                          Mohegan Lake, Nov 3, 1994

set activeButtonTranslation {#override 
    <Enter>:  exec("sV helpLine labelString $buttonHelp(%w)")
    <Leave>:  exec("sV helpLine labelString {}")
}

mergeResources topLevel \
    *XmPushButton.translations $activeButtonTranslation \
    *XmLabel.recomputeSize false *XmLabel.height 20 \
    *XmPushButton.activateCallback \
             {sV answerLine labelString "This is only a Demo!"} \
    *quit.activateCallback quit

XmRowColumn rc topLevel  entryAlignment ALIGNMENT_CENTER
 XmLabel helpLine rc labelString "" 
 XmLabel answerLine rc labelString ""
 XmRowColumn buttons rc orientation HORIZONTAL
 foreach b {quit edit file help} { XmPushButton $b buttons }
realize

set buttonHelp(quit) "Terminate the Program."
set buttonHelp(edit) "Edit the File"
set buttonHelp(file) "Load, Save or Print a File"
set buttonHelp(help) "Obtain help information"

