[comp.windows.x] problem using R3 asciiStringWidget

mikeo@sae.UUCP (Michael Ovington) (02/17/90)

      I am having a problem with the R3 text widget that has me stumped.

      As a simplified description, I have a Composite widget that has an
   AsciiStringWidget child that is one line tall. The composite widget is
   a child to a Form, so the hierarchy looks something like:
   ___________________________________________________________
   |Form                                                     |
   |      ...                                                |
   |_________________________________________________________|
   |  Composite                                              |
   ___________________________________________________________
   | label | | asciiStringWidget                             |
   ___________________________________________________________

      This works fine on Sun3's, Sun4's, DG Aviion, Decstation 3100, HP,
   and Apollo workstations under R2/R3/R4 based servers with a mixture
   of window managers (mwm, hpwm, uwm)
      BUT, when using the R4 twm on a Sun or Aviion (we don't have it on
   anything else yet), after resetting the text of the aaciiStringWidget,
   it locks up as far as further keyboard input is concerned. It will
   take mouse input: the mouse can be used to paste text cut from an
   xterm for example, but any keypress events that occur are propagated to
   the parent Form, which has done an
      XtAddEventHandler( form, KeyPressMask, ...);

      It looks to me as if the asciiStringWidget has removed its event
   handler for keyboard events, but only when twm is running. I don't
   see how this can happen, so I suspect something else is going on, but
   I am at a loss to understand what.

      I am resetting the text of the asciiStringWidget with the following
   code fragment:

   XtTextBlock          block;
   XtTextPosition       end;

   block.firstPos = 0;
   block.length = strlen( new_text);
   block.ptr = new_text;

   end = strlen( old_text);
   XtTextReplace( entryWidget, 0, end, &block);

      It has worked fine for ~2 years now, but R4 twm is the first ICCCM
   window manager we have tried. (unless mwm is compliant too).

      I am not modifying the translation table for the asciiStringWidget.
      I am not adding any action tables anywhere in the application.
      I am not making any undocumented calls to widget internals.
      I realize that I haven't provided enough information to reproduce
   my problem, but I am hoping for some pointers to where I might start
   LOOKING for a solution.

   ________________________________________________________________________
   Michael S. Ovington 			Software Architecture & Engineering
   (703) 276-7910			1600 Wilson Blvd, Suite 500
   uunet!sae!mikeo			Arlington, VA 22209
   ________________________________________________________________________

erik@sravd.sra.JUNET (Erik M. van der Poel) (02/17/90)

In article <9002162057.AA27338@sae.com> Michael Ovington writes:

> It looks to me as if the asciiStringWidget has removed its event
> handler for keyboard events, but only when twm is running.

Have you tried NoTitleFocus in ~/.twmrc? Have you tried compiling with
R4 libraries?

Erik M. van der Poel                  erik@sra.co.jp             (Japan)
SRA, 1-1-1 Hirakawa-cho, Chiyoda-ku   erik%sra.co.jp@uunet.uu.net  (USA)
Tokyo 102 Japan. TEL +81-3-234-2692   erik%sra.co.jp@mcvax.uucp (Europe)

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (02/21/90)

>      BUT, when using the R4 twm on a Sun or Aviion (we don't have it on
>   anything else yet), after resetting the text of the aaciiStringWidget,
>   it locks up as far as further keyboard input is concerned.

>       It looks to me as if the asciiStringWidget has removed its event
>    handler for keyboard events, but only when twm is running. I don't
>    see how this can happen, so I suspect something else is going on, but
>    I am at a loss to understand what.

There was a bug in the XToolkit that caused focus to be lost when using
twm and TitleFocus.  I believe that the problem has been fixed in R4, so
switching to an R4 Xt should solve your problem.  Until then you should be okay
of you set NoTitleFocus in twm.


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213