[comp.windows.x] Using a Callback to Get the character entered in a Text Widget

bball@maris.ucr.edu (alvaro monge) (01/30/91)

I am trying to get the character that the user enters while in an Athena
Text Widget.  The problem is that the callback routine is called before
the widget is updated with the new character.  That is the resource
XtNstring (which holds the text field of the widget) in the text widget
is not updated with the new character just entered.

I want to know what character the user typed in so that I could check
whether it was a digit or not.  Unless I have this character in my callback
routine there is no way of doing that.

What am I doing wrong?  i.e. is it a STANDARD behavior that the callback
routines are called BEFORE the widget is updated upon the user entering text??

Any hints....suggestions.....HELP!!!!

Al
bball@ucrmath.ucr.edu

bjaspan@athena.mit.edu (Barr3y Jaspan) (01/31/91)

In article <11525@ucrmath.ucr.edu>, bball@maris.ucr.edu (alvaro monge) writes:
|> I am trying to get the character that the user enters while in an Athena
|> Text Widget.

I am not familiar with the callbacks used by the Text widget because I never
use callbacks.  I suggest you add a translation table entry that calls an
action procedure that you provide whenever a character you care about is
pressed.  One of the arguments to an action procedure is the XEvent that
triggered the procedure, so you can extract the typed character from there.

-- 
Barr3y Jaspan, bjaspan@mit.edu
Watchmaker Computing