[comp.windows.x] text bug?

marshall@software.ORG.UUCP (10/01/87)

	Is this a bug on your system? It is on mine (it
definitely isn't a feature :-). I'm running an Apollo
DN580-T model using X version V10 R4. The first 3 compiled
programs work, but the last one doesn't.

		cc bug.c -lX
		cc bug.c -DXOR -lX
		cc bug.c -DMOUSE -lX
		cc bug.c -DXOR -DMOUSE -lX

The problem is that if I wait for a button pressed event, I can't
write text using the GXxor function. Any ideas? The problem program
follows.

Thanks in advance.


Eric Marshall
Software Productivity Consortium
1880 Campus Commons Drive, North
Reston, VA 22091
(703) 391-1838

CSNET: marshall@software.org
ARPANET: marshall%software.org@relay.cs.net  OR
         @relay.cs.net:marshall@software.org

----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----

#include <X/Xlib.h>

main()
{
  Window window;
  FontInfo *font;
  XButtonEvent event;

  XOpenDisplay( 0 );
  window = XCreateWindow( RootWindow, 100, 100, 200, 200, 3, WhitePixmap, BlackPixmap );
  XMapWindow( window );
  font = XOpenFont( "9x15" );

#ifdef MOUSE
  XSelectInput( window, ButtonPressed );
  XWindowEvent( window, ButtonPressed, &event );
#endif

  XTextPad( window, 50, 100, "hello there", 11, font->id, 0, 0,
            WhitePixel, BlackPixel,
#ifdef XOR
            GXxor,
#else
            GXcopy,
#endif
            AllPlanes );

  XFlush();

  sleep( 2 );
}