#!/bin/sh
#  fidget-widget modifies the output of XDesigner.
#  the creation function returns widget1 and does not create the parent.
#  marc + matthieu

NAME=$2
FILE=$1
sed "
    /^\*\* Generated by / a\\
	** Modified by fidget-widget, `date +%d-%h-%y`
    /Text\\.h>/s//TextF.h>/
    /XmCreateText/s//XmCreateTextField/
    /Widget widget0/d
    /^create_widget0/s//Widget $NAME/
    /int h_spacing/s//short h_spacing/
    /widget0 =/d
    /widget1 =/s/widget0/parent/
    /^}/i\\
	return widget1;
    " $FILE
