tim@ora.UUCP (Tim O'Reilly) (09/14/89)
Is there any way to have a single-click call one action, while a double-click calls another? This is a popular user-interface feature on the Mac that I thought to duplicate in an example. (Typically, if you click on a button, you get a dialog box asking for confirmation, but double-clicking bypasses the dialog and just does the action.) However, I am having terrible trouble getting it to work. *farewell.translations: #override\n\ <Btn1Up>(2): quit()\n\ <Btn1Down>,<Btn1Up>: confirm() Causes both actions to be invoked on a double-click (which makes sense, since the translations overlap). On the other hand: *farewell.translations: #override\n\ !<Btn1Up>(2): quit()\n\ <Btn1Down>,<Btn1Up>: confirm() disables the confirm action entirely. Reversing the order disables the quit action. Is there any magic I'm missing? Or is this just impossible to do, given the semantics of the translation manager precedence rules? Please reply by mail; since opening a new office on the West Coast, I haven't brought up news here yet, and have to post and read by logging in cross-country to our East Coast office. I will post a summary to the net. In fact, I'll do one better--if those of you who have experienced and surmounted the odd corner-cases of the translation manager will send me accounts of what you know, I'll reflect it all in the chapter on translations from our forthcoming X toolkit book, and will post a machine-readable copy of that section to the net for general consumption. Thanks in advance for your help, both on the double-click problem, and anything else you might volunteer. -- Tim O'Reilly @ O'Reilly & Associates, Inc. Publishers of Nutshell Handbooks 632 Petaluma Avenue, Sebastopol, CA 95472 707-829-8512, 800-338-6887 (in CA 800-533-6887), FAX 707-829-0104 Internet: tim@ora.com UUCP: uunet!ora!tim