rem: panel->retKey = XKeysymToKeycode(scrPtr->display, XK_Return); panel->escKey = XKeysymToKeycode(scrPtr->display, XK_Escape);
context: WMCreateInputPanel(WMScreen *scrPtr, WMWindow *owner, char *title, char *msg,		   char *defaultText, char *okButton, char *cancelButton){    WMInputPanel *panel;    int x, dw=0, aw=0, w;            panel = wmalloc(sizeof(WMInputPanel));    memset(panel, 0, sizeof(WMInputPanel));    panel->retKey = XKeysymToKeycode(scrPtr->display, XK_Return);    panel->escKey = XKeysymToKeycode(scrPtr->display, XK_Escape);    if (owner)	panel->win = WMCreatePanelWithStyleForWindow(owner, "inputPanel",						     WMTitledWindowMask);    else	panel->win = WMCreateWindowWithStyle(scrPtr, "inputPanel",					     WMTitledWindowMask);    WMSetWindowTitle(panel->win, "");    WMResizeWidget(panel->win, 320, 160);        if (title) {	WMFont *largeFont;		largeFont = WMBoldSystemFontOfSize(scrPtr, 24);		panel->tLbl = WMCreateLabel(panel->win);	WMMoveWidget(panel->tLbl, 20, 16);	WMResizeWidget(panel->tLbl, 320 - 40, WMFontHeight(largeFont)+4);	WMSetLabelText(panel->tLbl, title);	WMSetLabelTextAlignment(panel->tLbl, WALeft);	WMSetLabelFont(panel->tLbl, largeFont);		WMReleaseFont(largeFont);    }    if (msg) {	panel->mLbl = WMCreateLabel(panel->win);	WMMoveWidget(panel->mLbl, 20, 50);	WMResizeWidget(panel->mLbl, 320 - 40, 		       WMFontHeight(scrPtr->normalFont)*2);	WMSetLabelText(panel->mLbl, msg);	WMSetLabelTextAlignment(panel->mLbl, WALeft);    }        panel->text = WMCreateTextField(panel->win);    WMMoveWidget(panel->text, 20, 85);    WMResizeWidget(panel->text, 320 - 40, WMWidgetHeight(panel->text));    WMSetTextFieldText(panel->text, defaultText);    WMAddNotificationObserver(endedEditingObserver, panel, 			      WMTextDidEndEditingNotification, panel->text);    /* create buttons */    if (cancelButton)	aw = WMWidthOfString(scrPtr->normalFont, cancelButton, 			     strlen(cancelButton));        if (okButton)	dw = WMWidthOfString(scrPtr->normalFont, okButton,			     strlen(okButton));        w = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);    if (aw > w)	w = aw;    w += 30;    x = 310;    if (okButton) {	x -= w + 10;	panel->defBtn = WMCreateCustomButton(panel->win, WBBPushInMask					     |WBBPushChangeMask					     |WBBPushLightMask);	WMSetButtonAction(panel->defBtn, inputBoxOnClick, panel);	WMMoveWidget(panel->defBtn, x, 124);	WMResizeWidget(panel->defBtn, w, 24);	WMSetButtonText(panel->defBtn, okButton);	WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);	WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);	WMSetButtonImagePosition(panel->defBtn, WIPRight);    }    if (cancelButton) {	x -= w + 10;	panel->altBtn = WMCreateCommandButton(panel->win);	WMSetButtonAction(panel->altBtn, inputBoxOnClick, panel);	WMMoveWidget(panel->altBtn, x, 124);	WMResizeWidget(panel->altBtn, w, 24);	WMSetButtonText(panel->altBtn, cancelButton);    }    WMCreateEventHandler(W_VIEW(panel->win), KeyPressMask,			 handleKeyPress2, panel);    WMRealizeWidget(panel->win);    WMMapSubwidgets(panel->win);    WMSetFocusToWidget(panel->text);    return panel;}