#! ../mofe --f
# small example script to demonstrate the Layout widget 
# Gustaf Neumann  March 8, 1993

set Layout {vertical {
	space = (height label/2)
	$space <+inf -100%>
	horizontal {
		$space <-100%>
		label
		$space <+inf -100%>
        }
	$space <+inf -100%>
	horizontal {
		$space <-100%>
		textInsertionField <+inf -100% *>
		$space <-100%>
        }
	$space <+inf -100%>
	horizontal {
		$space <-100%>
		button1
		(3*$space) <+inf -100%>
		button2
		$space <-100%>
        }
	$space <+inf -100%>
  }}

mergeResources topLevel \
	*XmTextField*background white \
	*.background gray90 \
	*.foreground black \
         *l.layout $Layout

XmMainWindow main topLevel

if ![info exists Layout] {
  set msg {
    This program can only be used, when mofe was compiled 
    with support for the Layout widget. Your version of 
    mofe supports currently the following packages:
  }
  append msg \n $PACKAGES
  XmLabel l main labelString $msg recomputeSize false width 500 height 300 
  XmPushButton quit main activateCallback quit
  sV main messageWindow quit
} else {
  Layout l main
  XmLabelGadget label l labelString "Label Widget" 
  XmTextField textInsertionField l width 300
  XmPushButtonGadget button1 l labelString "Button 1" 
  XmPushButtonGadget button2 l labelString Quit activateCallback quit
}

sV main workWindow l
realize







