Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!ispd-newsserver!ism.isc.com!b1!xpert-mailer@expo.lcs.mit.edu From: cjmchale@cs.tcd.ie (Ciaran McHale) Newsgroups: comp.windows.x,in.xpert Subject: Re: How do I pick/hit graphical primitives in X ? Message-ID: <1991Mar16.160205.20935@cs.tcd.ie> Date: 16 Mar 91 16:02:05 GMT References: <1991Mar15.100902.16094@abblund.se> Sender: xpert-request@expo.lcs.mit.edu Organization: DSG, Dept. of Comp. Sci., Trinity College, Dublin. Lines: 30 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. Choices: 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. -- 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