/*
 * Copyright 1990 by Baylor College of Medicine ALL RIGHTS RESERVED. 
 *
 * This program is subject to a license agreement between 
 * Baylor College of Medicine and MIT. Any use inconsistent with
 * said license and any use by persons other than the faculty, 
 * students and staff at MIT or any use on a computer not operated 
 * as part of the Athena Computing Environment (ACE) is expressly 
 * prohibited.
 */
/* @(#)twmtrans.c	1.2  5/15/91 */
#include <X11/Intrinsic.h>

static Atom takeFocus = None;

static void ProcessTwmShell(w, event)
   Widget w;
   XEvent *event;
{
   int data;

   if (takeFocus == None)
      takeFocus = XInternAtom(XtDisplay(w), "WM_TAKE_FOCUS", False);

   XChangeProperty(XtDisplay(w), XtWindow(w), takeFocus, takeFocus,
      8, PropModeAppend, &data, 0);
}

void InitForTwm(w)
   Widget w;
{
   static XtActionsRec actions[] = 
   {
       {"processTwmShell", ProcessTwmShell}
   };

   static char *trans = "<Enter>: processTwmShell()";
   static Boolean first = True;

   XtTranslations trans_table;

   if (first)
   {
       XtAppAddActions(XtWidgetToApplicationContext(w),
                      actions, XtNumber(actions));
       first = False;
   }

   trans_table = XtParseTranslationTable(trans);
   XtAugmentTranslations(w, trans_table);
}
