Article View: comp.windows.x
Article #37546XSelectInput - what am I doing wrong?
From: jalred.ElSegundo
Date: Tue, 27 Feb 1990 23:45
Date: Tue, 27 Feb 1990 23:45
44 lines
2019 bytes
2019 bytes
I have a widget for which I would like to receive VisibilityNotify events.
However, I seem to be unable to select those events. I retrieve the current
event mask of the window using XtBuildEventMask, OR in VisibilityChangeMask,
and then set the event mask using XSelectInput. This doesn't seem to work.
If I get the new event mask after I XSelectInput, it is set to the original event
mask (the mask which was being used before I attempted to change it).
So what's the scoop? Am I attempting to misuse XSelectInput? My
configuration is SunSS1, SunOS4.0.3, X11R4, no fixes applied. My code is
below:
windowData.topLevel is a widget, created (before the XSelectInput call) by:
windowData.topLevel = XtInitialize("top", "Tool", NULL, 0, &argc, argv);
EventMask eventMask, newEventMask;
Display *myDisplay;
Window myWindow;
myDisplay = XtDisplay(windowData.topLevel);
myWindow = XtWindow(windowData.topLevel);
eventMask = XtBuildEventMask(windowData.topLevel);
printf("eventMask of topLevel = %x\n",eventMask);
newEventMask = eventMask | VisibilityChangeMask;
printf("newEventMask = %x\n", newEventMask);
XSelectInput(myDisplay, myWindow, newEventMask);
eventMask = XtBuildEventMask(windowData.topLevel);
printf("eventMask of topLevel = %x\n",eventMask);
This is the output of the printf's:
eventMask of topLevel = 220030
newEventMask = 230030
eventMask of topLevel = 220030
Looks like newEventMask is getting assigned correctly (eventMask | (1L<<16)),
but not sticking.
I'd appreciate any hints/solutions,
Jim Alred <jalred.elsegundo@xerox.com>
Technical Details
Message-ID:
<900227-154552-595@Xerox>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!XEROX.COM!jalred.ElSegundoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!XEROX.COM!jalred.ElSegundo From: jalred.ElSegundo@XEROX.COM Newsgroups: comp.windows.x Subject: XSelectInput - what am I doing wrong? Message-ID: <900227-154552-595@Xerox> Date: 27 Feb 90 23:45:38 GMT Sender: JAlred.ElSegundo@xerox.com Reply-To: JAlred.ElSegundo@xerox.com Organization: The Internet Lines: 44