Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!ben From: ben@hpcvlx.cv.hp.com (Benjamin Ellsworth) Newsgroups: comp.windows.x Subject: Re: Need help in interactive selection of a motif widget/gadget Message-ID: <100920123@hpcvlx.cv.hp.com> Date: 27 Oct 89 00:40:36 GMT References: <4219@hplabsz.HPL.HP.COM> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 43 (I don't understand why you cross posted to comp.windows.x. Anyways...) > ...Am I doing something wrong? In a word, yes. The easy answer is to set owner events true on the grab, and then the data in the event are exactly what you want. Looking at your code, I don't understand how it would ever work for the general case. Specifically: > while (XTranslateCoordinates(display, > parent_win, child_win, > parent_win_x, parent_win_y, > &parent_win_x, &parent_win_y, > &win) > && win) { > parent_win = child_win; > child_win = win; > child_win_x = parent_win_x; > child_win_y = parent_win_y; > } When win is set to NULL by XTranslateCoordinates, the entry condition for the while loop becomes false and the loop terminates. Unfortunately it terminates before updating child_win_x and child_win_y. The rest is, as they say, history. As far as I can tell, this code will *only* work when the parent and child window have coincident origins (such as a rowcolumn in a scrolledwindow before any user scrolling). ----------------------------------------------------------------------- Benjamin Ellsworth | ben@cv.hp.com | INTERNET Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP 1000 N.E. Circle | (USA) (503) 750-4980 | FAX Corvallis, OR 97330 | (USA) (503) 757-2000 | VOICE ----------------------------------------------------------------------- All relevant disclaimers apply. -----------------------------------------------------------------------