Changing windows

Linda Roy lroy at sgi.com
Tue Nov 20 06:30:44 AEST 1990


>Suppose, I wanted
>to allow the user to select the new graphics window with the mouse.  Is
>there a function which returns the id of the window the mouse is currently
>contained by (ACK! I've ended a sentence with a preposition)?
>

Look at 2.7.3 The Event Queue and 2.7.4 Window Manager Devices 
in the SGI 4Sight Programmer's Guide.


To select between multiple windows using the mouse location, queue INPUTCHANGE
which will be entered on the queue each time the mouse move into a different
window.  The value listed with the INPUTCHANGE is the graphics window id.

The events REDRAW and DEPTHCHANGE also return the graphics window id
and are needed to control redaw events and push/pops of a window.

in your initialization:
 
   qdevice( INPUTCHANGE );  /* may be done automatically */


in your mouse event loop:

   dev = qread(&value);
   if (dev == INPUTCHANGE )
     /* value returned is the current graphics window id */


Linda



More information about the Comp.sys.sgi mailing list