[in.xpert] How do I pick/hit graphical primitives in X ?

cjmchale@cs.tcd.ie (Ciaran McHale) (03/17/91)

In <1991Mar15.100902.16094@abblund.se> erik@abblund.se (Erik Sparre) writes:

>When you develop a direct manipulation graphical user interface you
>will sooner or later need the ability to detect whether the user pointed
>at a certain graphical object (line, ect, circle).
>Is there any good way to detect picking in X or any X-based library
>without having to do the calculations yourself ?

This is one of the limitations of raw Xlib. It *is* possible to write
the appropriate routines, but it's a major pain to do so. It's best to
have such commonly used functionality provided in a graphical toolkit to
prevent application developers having to reinvent the wheel each time.

	o Do the calculations yourself.
	o Use Display Popstscript.
	o Use Interviews, a C++ windowing/graphics library.
	o Write your own OO graphics library in which each graphical
	  object has a method does_contain_point(short x, short y).

This last approach is possible but its a pain to do yourself.

Ciaran McHale		"Verbosity says it all"			      ____
Department of Computer Science, Trinity College, Dublin 2, Ireland.   \  /
Telephone: +353-1-772941 ext 1538	FAX: +353-1-772204	       \/
Telex: 93782 TCD EI			email: cjmchale@cs.tcd.ie