PT2WIN(3L)

NAME
pt2win: point2window - find process table address of a window

SYNOPSIS
#include <dmd.h>
Proc *point2window (btn)
int btn;

DESCRIPTION
The point2window function implements the user interface for pointing to windows that are used by the Reshape, Move, Top, etc. functions of the 630 MTG main button 3 menu.

When point2window is called by an application program, the mouse cursor changes to a target icon. The function then busy waits for the user to move the mouse cursor into a window and press the button specified by btn. When this happens, the mouse cursor will change back to the previous mouse cursor, and the process table address of the window pointed to will be returned.

The function will return (Proc *)0 if the user either clicks button btn while the target is over background texture or clicks a mouse button other than button btn.

EXAMPLE
The follow subroutine will flash a window pointed to with button 3. Note that in the following code, p->layer is equivalent to &display for process p and that p->rect is equivalent to Drect for process p.

    #include <dmd.h>
    flash()
    {
    	Proc *p;
    	Proc *point2window();
    	p = point2window(3);
    	if(p) {
    		rectf(p->layer, p->rect, F_XOR);
    		nap(20);
    		rectf(p->layer, p->rect, F_XOR);
    	}
    }

SEE ALSO
globals(3R), rectf(3R), sleep(3R).