rem: x = 400;
context: WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner, 		   char *title, char *msg, char *defaultButton,		   char *alternateButton, char *otherButton){    WMAlertPanel *panel;    int x, dw=0, aw=0, ow=0, w;    WMBox *hbox;            panel = wmalloc(sizeof(WMAlertPanel));    memset(panel, 0, sizeof(WMAlertPanel));    panel->retKey = XKeysymToKeycode(scrPtr->display, XK_Return);    panel->escKey = XKeysymToKeycode(scrPtr->display, XK_Escape);    if (owner) {	panel->win = WMCreatePanelWithStyleForWindow(owner, "alertPanel",						     WMTitledWindowMask);    } else {	panel->win = WMCreateWindowWithStyle(scrPtr, "alertPanel",					     WMTitledWindowMask);    }    WMSetWindowInitialPosition(panel->win,	 (scrPtr->rootView->size.width - WMWidgetWidth(panel->win))/2,	 (scrPtr->rootView->size.height - WMWidgetHeight(panel->win))/2);    WMSetWindowTitle(panel->win, "");    panel->vbox = WMCreateBox(panel->win);    WMSetBoxExpandsToParent(panel->vbox);    WMSetBoxHorizontal(panel->vbox, False);    WMMapWidget(panel->vbox);    hbox = WMCreateBox(panel->vbox);    WMSetBoxHorizontal(hbox, True);    WMMapWidget(hbox);    WMAddBoxSubview(panel->vbox, WMWidgetView(hbox), False, True, 80, 0, 5);    panel->iLbl = WMCreateLabel(hbox);    WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);    WMMapWidget(panel->iLbl);    WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);    if (scrPtr->applicationIcon) {			WMSetLabelImage(panel->iLbl, scrPtr->applicationIcon);    }    if (title) {	WMFont *largeFont;		largeFont = WMBoldSystemFontOfSize(scrPtr, 24);	panel->tLbl = WMCreateLabel(hbox);	WMMapWidget(panel->tLbl);	WMAddBoxSubview(hbox, WMWidgetView(panel->tLbl), True, True, 			64, 0, 0);	WMSetLabelText(panel->tLbl, title);	WMSetLabelTextAlignment(panel->tLbl, WALeft);	WMSetLabelFont(panel->tLbl, largeFont);	WMReleaseFont(largeFont);    }    /* create divider line */        panel->line = WMCreateFrame(panel->win);    WMMapWidget(panel->line);    WMAddBoxSubview(panel->vbox, WMWidgetView(panel->line), False, True,		    2, 2, 5);    WMSetFrameRelief(panel->line, WRGroove);    if (msg) {	panel->mLbl = WMCreateLabel(panel->win);	WMMapWidget(panel->mLbl);	WMAddBoxSubview(panel->vbox, WMWidgetView(panel->mLbl), True, True,			WMFontHeight(scrPtr->normalFont)*4, 0, 5);	WMSetLabelText(panel->mLbl, msg);	WMSetLabelTextAlignment(panel->mLbl, WACenter);    }        hbox = WMCreateBox(panel->vbox);    WMSetBoxHorizontal(hbox, True);    WMMapWidget(hbox);    WMAddBoxSubview(panel->vbox, WMWidgetView(hbox), False, True, 24, 0, 0);        /* create buttons */    if (otherButton) 	ow = WMWidthOfString(scrPtr->normalFont, otherButton,			     strlen(otherButton));    if (alternateButton)	aw = WMWidthOfString(scrPtr->normalFont, alternateButton, 			     strlen(alternateButton));        if (defaultButton)	dw = WMWidthOfString(scrPtr->normalFont, defaultButton,			     strlen(defaultButton));        dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);        aw += 30;    ow += 30;    dw += 30;        w = WMAX(dw, WMAX(aw, ow));    if ((w+10)*3 < 400) {	aw = w;	ow = w;	dw = w;    } else {	int t;	t = 400 - 40 - aw - ow - dw;	aw += t/3;	ow += t/3;	dw += t/3;    }    x = 400;    if (defaultButton) {	x -= dw + 10;	panel->defBtn = WMCreateCommandButton(panel->win);	WMSetButtonAction(panel->defBtn, alertPanelOnClick, panel);	WMAddBoxSubviewAtEnd(hbox, WMWidgetView(panel->defBtn),			     False, True, dw, 0, 5);	WMSetButtonText(panel->defBtn, defaultButton);	WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);	WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);	WMSetButtonImagePosition(panel->defBtn, WIPRight);    }    if (alternateButton) {	x -= aw + 10;	panel->altBtn = WMCreateCommandButton(panel->win);	WMAddBoxSubviewAtEnd(hbox, WMWidgetView(panel->altBtn),			     False, True, aw, 0, 5);	WMSetButtonAction(panel->altBtn, alertPanelOnClick, panel);	WMSetButtonText(panel->altBtn, alternateButton);    }    if (otherButton) {	x -= ow + 10;		panel->othBtn = WMCreateCommandButton(panel->win);	WMSetButtonAction(panel->othBtn, alertPanelOnClick, panel);	WMAddBoxSubviewAtEnd(hbox, WMWidgetView(panel->othBtn),			     False, True, ow, 0, 5);	WMSetButtonText(panel->othBtn, otherButton);	    }        WMMapSubwidgets(hbox);        WMCreateEventHandler(W_VIEW(panel->win), KeyPressMask,			 handleKeyPress, panel);    WMRealizeWidget(panel->win);    WMMapSubwidgets(panel->win);    return panel;}