razdan@oakhill.UUCP (Anshuman Razdan) (10/31/89)
My problem is as follows : I am trying to use the XHp widgets( with patches applied for X11R3) on X11/NeWS server on a SUN 3/470. The problem is actually with the textwidget(HPtextwidget). It does not faithfully reproduce the keyboard input in to the widget. For example the char "d" is returned as blank and char "i" performs the equivalence of a RETURN or ENTER. This did not happen when I used the same widget under R2. I tried lookin into the code of TextEdit.c int he routine InsertChar. The code looks as follows: static void InsertChar(ctx, event) /*--------------------------------------------------------------------------+*/ XwTextEditWidget ctx; XEvent *event; { unsigned char strbuf[STRBUFSIZE]; int keycode; XwEditResult result; XwTextBlock text; text.length = XLookupString (event, strbuf, STRBUFSIZE, &keycode, &compose_status); if (text.length==0) return; StartAction(ctx, event); text.ptr = &strbuf[0];; text.firstPos = 0; if (result = ReplaceText(ctx, ctx->text.insertPos, ctx->text.insertPos, &text, TRUE)) { if (result != XweditReject) XBell(XtDisplay(ctx), 50); EndAction(ctx); return; } _XwSetCursorPos(ctx, (*(ctx->text.source->scan))(ctx->text.source, ctx->text.insertPos, XwstPositions, XwsdRight, text.length, TRUE)) ; _XtTextSetNewSelection(ctx, ctx->text.insertPos, ctx->text.insertPos); EndAction(ctx); } /*--------------------------------------------------------------------------+*/ While debugging I noticed that the XLookUpString call did not return the proper string/char back (in strbuf). Also for <KEY>i this routine did not get called at all. Seems like there is a problem in reporting and appropriatly sending the events to proper routine(s). I am confused. Has anybody out there in the ether encountered this. Suggestions and solutions welcome. Thanx in advance. Anshuman Razdan Sector CAD Motorola Austin Tx cs.utexas.edu!oakhill.chanakya!razdan
razdan@oakhill.UUCP (Anshuman Razdan) (10/31/89)
My problem is as follows : I am trying to use the XHp widgets( with patches applied for X11R3) on X11/NeWS server on a SUN 3/470. The problem is actually with the textwidget(HPtextwidget ). It does not faithfully reproduce the keyboard input in to the widget. For example the char "d" is returned as blank and char "i" performs the equivalence of a RETURN or ENTER. This did not happen when I used the same widget under R2. I tried lookin into the code of TextEdit.c int he routine InsertChar. The code looks as follows: static void InsertChar(ctx, event) /*--------------------------------------------------------------------------+*/ XwTextEditWidget ctx; XEvent *event; { unsigned char strbuf[STRBUFSIZE]; int keycode; XwEditResult result; XwTextBlock text; text.length = XLookupString (event, strbuf, STRBUFSIZE, &keycode, &compose_status); if (text.length==0) return; StartAction(ctx, event); text.ptr = &strbuf[0];; text.firstPos = 0; if (result = ReplaceText(ctx, ctx->text.insertPos, ctx->text.insertPos, &text, TRUE)) { if (result != XweditReject) XBell(XtDisplay(ctx), 50); EndAction(ctx); return; } _XwSetCursorPos(ctx, (*(ctx->text.source->scan))(ctx->text.source, ctx->text.insertPos, XwstPositions, XwsdRight, text.length, TRUE)) ; _XtTextSetNewSelection(ctx, ctx->text.insertPos, ctx->text.insertPos); EndAction(ctx); } /*--------------------------------------------------------------------------+*/ While debugging I noticed that the XLookUpString call did not return the proper string/char back (in strbuf). Also for <KEY>i this routine did not get called at all. Seems like there is a problem in reporting and appropriatly sending the events to proper routine(s). I am confused. Has anybody out there in the ether encountered this. Suggestion s and solutions welcome. Thanx in advance. Anshuman Razdan Sector CAD Motorola Austin Tx cs.utexas.edu!oakhill.chanakya!razdan