garys@earth.cchem.berkeley.edu (Gary Shea) (08/05/89)
I am using the Dialog widget as a simple prompt for a file name, with a "Confirm" button for the user to press when the filename is right. I'd like pressing Return within the prompt string (the Dialog widget's "value" Text widget child) to be equivalent to pressing the "Confirm" button. The problem is that if the Text widget has an action in its translation table for the Return key, it will not allow the accelerator to override it, i.e. the following does not work: xf*value.translations: #replace\n\ Ctrl<Key>U: beginning-of-line() kill-to-end-of-line()\n\ Ctrl<Key>H: delete-previous-character()\n\ <Key>: insert-char() xf*confirm.accelerators: #override \n\ <Key>Return: set() notify() unset() If I remove the "<Key>: insert-char()" part of the Text widget's translation table, then the accelerator works. The only "solution" I have found is to individually place each possible filename character in the translation table for the Text widget (blecch): <Key>a: insert-char() <Key>b: insert-char() etc. Is this a bug, have i missed something in ye olde FM, is there A Better Way? TIA... gary