[comp.windows.x] Coercing chars in XView panel text items?

chris@flood.com (Chris Newton) (02/09/91)

I'm trying to implement a capability in which certain text items in
a given XView panel coerce user input to a particular case.  For example,
if the item is "upper-case only", I want all lower-case letters typed
to be coerced to upper-case when entered into the item.

I've attempted to modify the XView event structure (NOT the raw XEvent
structure) in my text notify procedure as follows:

	char c = event_action(event);
	...

	if (islower(c)) {
           event_set_id(toupper(c));
	}
	...

        return (PANEL_INSERT);

This has no effect - the original character shows up in the item.  I've
checked the event structure before and after and all fields look kosher.
Obviously, the text item package isn't using the modified event structure
when my notify proc. returns.

Any thoughts?  Can this be done in a device-independent way without hacking
the text item package?  (I'd rather not try tweaking the XEvent structure,
since this keycodes are so device-dependent.)

Thanks in advance.

-Chris


-- 
Chris B. Newton			The Flood Group, Inc.	Lawndale, Ca.
Internet: chris@flood.com	(213) 219-1155
UUCP: ...!uunet!flood!chris