See XtSetWarningHandler. When a warning message is to be printed by the Xt intrinsics and the global variable xt-warning-handler is bound to a compound procedure, this procedure is invoked with the error message (a string) as an argument. When this variable is not bound to a compound procedure, the message is sent to the current output port. The initial value of this variable is the empty list.
This interface is bogus and will be replaced by a more useful mechanism
in future versions of the software.