Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!lth.se!abblund!abblund.se!erik From: erik@abblund.se (Erik Sparre) Newsgroups: comp.windows.x Subject: How do I pick/hit graphical primitives in X ? Message-ID: <1991Mar15.100902.16094@abblund.se> Date: 15 Mar 91 10:09:02 GMT Sender: erik@abblund.se (Erik Sparre) Organization: ABB Corporate Research, Lund, Sweden Lines: 23 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). I've seen hardware that supports this by letting you set up a very small clip window around the cursor hot-spot, redraw all primitives (without actually doing any drawing). As soon as a primitive draws something inside the clip window, a flag is raised and/or an interrupt is signaled. A straightforward and pretty fast method since no display memory is updated during the redraw. Some toolkits/systems, like GKS, supports picking as a part of the API. Is there any good way to detect picking in X or any X-based library without having to do the calculations yourself ? Thanks -- Erik Sparre | Email erik@abblund.se ABB Corporate Research | Phone +46 46 168527 Dept. KLL, Lab for Man-Machine Communication | Telex 33709 IDEON Research Park, S-223 70 LUND, SWEDEN | Fax +46 46 145620