Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!asente From: asente@decwrl.dec.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: Help with double-click recognition. Message-ID: <1922@bacchus.dec.com> Date: 13 Oct 89 18:29:56 GMT References: <603@granite.dec.com> Organization: DEC Western Software Lab Lines: 33 >I've >tried in many ways to figure out how to get it to call one >callback on a single button press, and another for a double-click. >So far, I've not been succesful, and it seems from my understanding >of the documentation and from my experimentation that it might not >be possible. You got it. There really is a reason for it. X is network-based. There's no way for an application to know, upon receiving one button click, whether there's another one coming along. Consider the following scenario: -User clicks button twice. For some reason (process scheduling, network delays, whatever) the first event is delivered to the application but the second one isn't. -Application wants to know whether there is another click coming. It looks in the queue, but nothing is there. It decides to wait a while and check again; still nothing there. -Application decides to execute single button action. -The second event arrives with a timestamp that indicates that it took place immediately after the first one, within the double-click interval. What does the application do? Unless the application is willing to do some extremely nasty things to the user (like always waiting to see the next event before processing a single click, which might take seconds or even longer) it can't know whether a click is the first in a double click. It has nothing to do with the toolkit; it's intrinsic to X. -paul asente asente@decwrl.dec.com decwrl!asente