| |||||||||||
Unintelligible behaviour of tk_dialog function Posted by Dimon (Dimon), 20 February 2007 Being in testing of new script, I saw a strange behavior of standart Tk's dialog showing function - tk_dialog.The syntax of function call is: Code:
Zero means the index of the button that is to be the default button of the dialog (0 for the leftmost button, and so on). There are 3 buttons in the sample. If any button would be pressed by mouse, tk_dialog returns a code: 0 if 1-st button was pressed, 1 if 2-nd and so on. But when I try to select a buttons with pressing 'tab' key, focus is changing, but I see only one button pressed when Enter key is pressing. Can I change buttons focus with keyboard withous mouse? Posted by admin (Graham Ellis), 21 February 2007 The behaviour is controlled not only by the widgit itself, but also by the window manager. The windows defaults, etc, get involved too. So navigation keystrokes may indeed not reach your application. I think that's what your looking for me to confirm and explain?Posted by Dimon (Dimon), 21 February 2007 Well Graham, yesterday's evening I have correct that dialog's behavior. I found the next code block in tk_dialog's source code (the 'dialog.tcl' file in tk8.4 library):Code:
It means that author has design one common <Return> event for dialog's toplevel form. Well, I have delete code snippet showed above and have written the next code block to improve tk_dialog's functionality: Code:
It works correctly Posted by admin (Graham Ellis), 21 February 2007 Excellent ... I hope you're gooing to submit yor change back to the Tcl team for inclusion in a future release?This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |