anl@comp.lancs.ac.uk (Tony Lennard) writes:
> Date: Fri, 30 Aug 1996 10:21:32 GMT
> Organization: Computing Department, Lancaster University.
>
> I can't get XNextEvent to work - eg. in the following code from teach xlib
> ...
> ....
> /* If I add */
>
> XSelectInput(dpy,win,ButtonPressMask);
> XNextEvent(dpy,hope);
>
> /* then the program waits till the button is pressed, but hope just contains
>
> : hope =>
> ** <NULL>
>
> instead of the external pointer to the event structure that I had expected.
I guess you are supposed to create the external pointer yourself
and assign it to hope before you call XNextEvent.
Unfortunately REF XEvents assumes you know how to do that and does
not tell you how. I don't know how either, but maybe you can find
out from
REF EXTERNAL or REF EXTERNAL_DATA or REF DEFSTRUCT
It looks to me as if there is a bug in the system. Instead of giving
"hope" that NULL value it should have caused an error.
It appears simply to have corrupted whatever value hope had before
(probably an undef record if you had not assigned anything to it.)
Sorry I can't be of more help.
Aaron
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs )
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk
Phone: +44-121-414-4775 (Sec 3711) Fax: +44-121-414-4281
|