[comp.windows.x] lost Keyboard events after a PopUp

kulkarni@umn-cs.CS.UMN.EDU (Srinivas R. Kulkarni) (07/29/89)

     I am having a problem with PopUps and I was wondering if 

     anyone could help me out.

     I receive keyboard events just fine until I do any sort

     of PopUp. After a popup, my keyboard events  are effectively

     ignored! Has anybody out there had similar problems with popups?

     Sorry if I have wasted precious net-time.

     Thanks In Advance.


Srinivas R Kulkarni
U of M
Mpls, Mn

-----------------code--------------------

static  XtActionsRec simple_actions[] = {
        { "Window_Event", (XtActionProc) Window_Event},
};

static  String simpleWidgTranslations =
         "<Btn1Down>             : Window_Event() \n\
          <Motion>               : Window_Event() \n\
          <Key>                  : Window_Event()";

static void
Window_Event(widget, e, client_data)
Widget widget;
XEvent * e;
caddr_t client_data;
{

    switch(e->type) {
      case KeyPress: printf("keyboard event"); 
		     break;

      case MotionNotify: printf("Motion event"); 
		     break;
}

   dialog_shell= XtCreatePopupShell("dialog_shell",
                overrideShellWidgetClass, toplevel, 
		  shell_args, XtNumber(shell_args));

-------------------------------------------------

converse@EXPO.LCS.MIT.EDU (Donna Converse) (07/31/89)

> 
>      I am having a problem with PopUps and I was wondering if 
>      anyone could help me out.
>      I receive keyboard events just fine until I do any sort
>      of PopUp. 

Your code fragments didn't indicate which interface you are using to actually
do the popup.  Some types of popups "grab" keyboard events, meaning, any
keyboard input to the application will be redirected to the popup.  
Read section 5.4 of the X Intrinsics manual, "Mapping a Pop-Up Widget".

> 
> static void
> Window_Event(widget, e, client_data)

Wrong number of arguments, and type mismatch on argument 3, for an action
procedure.

> 
>    dialog_shell= XtCreatePopupShell("dialog_shell",
>                 overrideShellWidgetClass, toplevel, 
> 		  shell_args, XtNumber(shell_args));

Unless you are implementing a set of popup menus (in which case you 
probably *would* want to do an exclusive grab of keyboard events)
the ICCCCM recommends using transientShellWidgetClass, not override.


Donna Converse
converse@expo.lcs.mit.edu

> 
> -------------------------------------------------