Unintelligible behaviour of tk_dialog function
Posted by Dimon (Dimon), 20 February 2007Being 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:
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 2007The 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 2007Well 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):
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:
It works correctly
Posted by admin (Graham Ellis), 21 February 2007Excellent ... I hope you're gooing to submit yor change back to the Tcl team for inclusion in a future release?
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho