#! ../mofe --f
# script to demonstrate percent codes in actions
# <Tab>, <Esc> and <Enter> are still handled by the RowColumn widget
# Gustaf Neumann, Mohegan Lake,   Jan 22, 1994

XmRowColumn rc topLevel \
  resizeWidth false width 200 \
  isAligned true entryAlignment ALIGNMENT_CENTER

XmLabel l rc \
  traversalOn true \
  labelString "Press\na Key or a Button\nin this Area" \
  translations {#replace
    <KeyPress>:    exec("reportK %w %t %x %y %X %Y \"%a\" %k %s %S")
    <ButtonPress>: exec(reportB %w %t %x %y %X %Y %b %S)
    <BtnMotion>:   exec(reportB %w %t %x %y %X %Y ? %S)
  }
  XmPushButton Quit rc activateCallback quit
realize

proc reportK {w t x y X Y a k s S} {
  sV $w labelString "Widget: $w,  Event: $t\nPos: $x/$y,  RootPos: $X/$Y\nKey= <$a> $s $k state=$S"
}
proc reportB {w t x y X Y b S} {
  sV $w labelString "Widget: $w,  Event: $t\nPos: $x/$y,  RootPos: $X/$Y\nButton= $b state=$S"
}
