SimpleMenu.cpp
/*	Function Name: CreateLabel
 *	Description: Creates a the menu label.
 *	Arguments: w - the smw widget.
 *	Returns: none.
 * 
 * Creates the label object and makes sure it is the first child in
 * in the list.
 */
Function Name: CreateLabel
Description: Creates a the menu label.
Arguments: w - the smw widget.
Returns: none.

Creates the label object and makes sure it is the first child in
in the list.
Function Name : CreateLabel Description : Creates a the menu label . Arguments : w - the smw widget . Returns : none . Creates the label object and makes sure it is the first child in in the list .
static void
CreateLabel(Widget w)
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    Widget * child, * next_child;
    int i;
    Arg args[2];
    if ( (smw->simple_menu.label_string == NULL) ||
	 (smw->simple_menu.label != NULL) ) {
	char error_buf[BUFSIZ];
	(void) sprintf(error_buf, "Xaw Simple Menu Widget: %s or %s, %s",
		"label string is NULL", "label already exists", 
		"no label is being created.");
	XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
	return;
    }
    XtSetArg(args[0], XtNlabel, smw->simple_menu.label_string);
    XtSetArg(args[1], XtNjustify, XtJustifyCenter);
    smw->simple_menu.label = (SmeObject) 
	                      XtCreateManagedWidget("menuLabel", 
					    smw->simple_menu.label_class, w,
					    args, TWO);
    next_child = NULL;
    for (child = smw->composite.children + smw->composite.num_children,
	 i = smw->composite.num_children ; i > 0 ; i--, child--) {
	if (next_child != NULL)
	    *next_child = *child;
	next_child = child;
    }
    *child = (Widget) smw->simple_menu.label;
}
static void CreateLabel ( Widget w ) { SimpleMenuWidget smw = ( SimpleMenuWidget ) w ; Widget * child , * next_child ; int i ; Arg args [ 2 ] ; if ( ( smw -> simple_menu . label_string == NULL ) || ( smw -> simple_menu . label != NULL ) ) { char error_buf [ BUFSIZ ] ; ( void ) sprintf ( error_buf , " " , " " , " " , " " ) ; XtAppWarning ( XtWidgetToApplicationContext ( w ) , error_buf ) ; return ; } XtSetArg ( args [ 0 ] , XtNlabel , smw -> simple_menu . label_string ) ; XtSetArg ( args [ 1 ] , XtNjustify , XtJustifyCenter ) ; smw -> simple_menu . label = ( SmeObject ) XtCreateManagedWidget ( " " , smw -> simple_menu . label_class , w , args , TWO ) ; next_child = NULL ; for ( child = smw -> composite . children + smw -> composite . num_children , i = smw -> composite . num_children ; i > 0 ; i -- , child -- ) { if ( next_child != NULL ) * next_child = * child ; next_child = child ; } * child = ( Widget ) smw -> simple_menu . label ; }
Function Name: CreateLabel
      Description: Creates a the menu label.
Function Name : CreateLabel Description : Creates a the menu label .