diff options
author | hobbs <hobbs> | 2007-10-30 01:57:54 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-10-30 01:57:54 (GMT) |
commit | b8d5cb3dc1cfd00eed4e1b1e232251019a43f0b6 (patch) | |
tree | 7041a42b48870bc050d2aea2eaee9195e8291e9e /library/listbox.tcl | |
parent | 6ec3e0445837fcebbb70b19d8affb34c92c5646e (diff) | |
download | tk-b8d5cb3dc1cfd00eed4e1b1e232251019a43f0b6.zip tk-b8d5cb3dc1cfd00eed4e1b1e232251019a43f0b6.tar.gz tk-b8d5cb3dc1cfd00eed4e1b1e232251019a43f0b6.tar.bz2 |
* tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test:
* library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl:
* library/msgbox.tcl, library/optMenu.tcl, library/tclIndex:
* library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt:
* library/demos/tcolor, library/demos/text.tcl:
* library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look
* library/ttk/fonts.tcl: Update of Tk default look in 8.5
* macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look
* unix/tkUnixDefault.h: with minor modifications for Win32/Aqua.
* win/tkWinDefault.h: Uses Tk*Font definitions throughout for
* win/tkWinFont.c: classic widgets. [Bug #1820344]
* library/obsolete.tcl (::tk::classic::restore): This restores
changes made to defaults in 8.5 using the 'option' command,
segmented into logical groups.
Diffstat (limited to 'library/listbox.tcl')
-rw-r--r-- | library/listbox.tcl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index 27cb114..26f494e 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk listbox widgets # and provides procedures that help in implementing those bindings. # -# RCS: @(#) $Id: listbox.tcl,v 1.15 2005/09/10 14:53:20 das Exp $ +# RCS: @(#) $Id: listbox.tcl,v 1.16 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. @@ -35,7 +35,7 @@ bind Listbox <1> { if {[winfo exists %W]} { - tk::ListboxBeginSelect %W [%W index @%x,%y] + tk::ListboxBeginSelect %W [%W index @%x,%y] 1 } } @@ -227,7 +227,7 @@ if {"x11" eq [tk windowingsystem]} { # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. -proc ::tk::ListboxBeginSelect {w el} { +proc ::tk::ListboxBeginSelect {w el {focus 1}} { variable ::tk::Priv if {[$w cget -selectmode] eq "multiple"} { if {[$w selection includes $el]} { @@ -243,6 +243,12 @@ proc ::tk::ListboxBeginSelect {w el} { set Priv(listboxPrev) $el } event generate $w <<ListboxSelect>> + # check existence as ListboxSelect may destroy us + if {$focus && [winfo exists $w] + && [string is true -strict [$w cget -takefocus]] + && [$w cget -state] eq "normal"} { + focus $w + } } # ::tk::ListboxMotion -- |