Next: XFProcEditPaste Up: Edit Previous: XFProcEditLoadTemplate

## XFProcEditMakeAProc

Calling this procedure creates a procedure from the specified widget or the current widget (if no widget was specified). The new procedure is named V<WidgetClass><pathName>. The widget structure remains in the application. Making a widget structure a procedure allows it to dynamically reproduce complex widget structures. This can be useful for applications where several toplevels contain the same sub widget structure. If no widget path is specified, the current widget path is used.

The created procedure is called with one parameter to create a new instance of the widget tree. This parameter specifies the parent name of the widget. The programmer has to guarantee that the parent will not contain the same widget structure more than once.

The call of the procedure can have additional parameters which are used to configure the created widget structure. Calling the procedure with a parent name that already contains the widget structure allows it to reconfigure the widget tree. The parameters are the usual resource pairs. First the resource name, and then the new value. The resource is set for all widgets that support this resource. If a resource is to be set for one specific subwidget, the complete pathname is specified as a parameter, followed by the usual resourcename/resourcevalue pair. There are three special configuration parameters that are only used when the widget structure is created. They are named -startupSrc, -middleSrc and -endSrc. Each parameter gets one argument. The startupSrc is evaluated before any widget is created. The middleSrc is evaluated when all widgets are created, but before they are mapped. The endSrc is evaluated before the procedure is finished.