#! ../mofe --f
# This script demonstrates how to create multiple edit panes sharing the
# the same text source
# 
# Gustaf Neumann                             Mohegan Lake, Dec 3 1994
mergeResources topLevel \
    *columns 80 *editMode MULTI_LINE_EDIT \
    *activateCallback %w

XmRowColumn rc topLevel
 XmPanedWindow p rc
  XmScrolledText e p rows 30 paneMinimum 20 allowResize true \
      value "This is text is to be shared...."
 XmRowColumn btns rc orientation horizontal
 XmPushButton addTextPane btns
 XmPushButton quit btns
realize

set nrPanes 1
proc addTextPane {} {
  global nrPanes 
  set newHt [expr 9*[gV p height]/(10*[incr nrPanes])]
  XmScrolledText e$nrPanes p \
      allowResize true source [gV e source] \
      paneMinimum $newHt
  sV [parent e$nrPanes] paneMinimum 20
}
