Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph Swick) Newsgroups: comp.windows.x Subject: Re: Use of accelerators (bug or misunderstanding?) Message-ID: <9006292056.AA14058@lyre.MIT.EDU> Date: 29 Jun 90 20:56:41 GMT References: Sender: daemon@athena.mit.edu (Mr Background) Organization: DEC/MIT Project Athena Lines: 18 The following program creates a Form with two textWidgets and two CommandWidgets. Given the acclerations I would *expect* that pressing the return key in 'text1' would call the callback for command1' and pressing the return key in 'text2' would call the callback for 'command2'. However, although the first expectation is fulfilled, pressing the return key in 'text2' calls the callback for 'command1'. This due to a bug in the implementation of accelerators. In R4 (and earlier), parsed accelerator tables are not sharable objects; you need a separate table for each accelerator source widget instance. This is handled automatically if accelerators are specified as resources, but since you are parsing the table yourself you fall into the trap. As a work-around, simply call XtParseAcceleratorTable a second time for 'command2'. Yes, we intend to fix this bug (soon, in fact :-).