Brief Index      Full Index      Events Index      I.M. Reference

Get_Location


Functions

void Get_Location (float *x, float *y)

Function Documentation

void Get_Location ( float *  x,
float *  y 
)

Performs all the work needed to have the user indicate a raw 2-D position. Returns the position to your program.

Parameters:
x - The 2-D location indicated by the user. The lower-left extreme of the locater device returned as (-1.0, -1.0); the upper-right as (+1.0, +1.0). Passed by reference always. Returned to caller.
y -

DETAILS

Get_Location() is a utility routine that combines a common sequence of input routines. The sequence does the work necessary to start the system listening to an input device. The sequence waits for the user to indicate a location, puts the system back to the way it was, and returns the location.

Use Get_Location() when you're only interested in raw position information. Use Get_Selection() when you're interested in that raw position as it relates to your picture.

In pseudo-C, Get_Location() corresponds to the following:


		Enable_Location_Events("?locater", "?Picture","v*^") 
		do Await_Event (&type) 
		until (strcmp (type, "location") == 0) 
		Disable_Location_Events("?locater", "?Picture","v*^") 
		Show_Location (&x, &y) 

The "x" and "y" are returned to the original caller. Show_Location_Source() can then be called to gain extra information about the location event.

NOTES

Get_Location() updates the display, courtesy of Await_Event() .

Get_Location() does not verify that the location event received matches the type of location event enabled.

Get_Location() and Show_Location() both return the same information to your program. Get_Location() is a high-level routine that does a variety of work. Show_Location() is a low-level routine whose only function is to extract one existing piece of information from the database.

The "Disable Event" at the end of Get_Location() gets propagated out the device at the next call to Await_Event() or Check_For_Events() .

RESTRICTIONS

See also:
Get_Selection, Await_Event, Enable_Location_Events, Show_Location, Show_Location_Source, Requeue_Event.

Brief Index      Full Index      Events Index      I.M. Reference