diff options
author | jenglish <jenglish@noemail.net> | 2006-12-17 21:09:46 (GMT) |
---|---|---|
committer | jenglish <jenglish@noemail.net> | 2006-12-17 21:09:46 (GMT) |
commit | b5eb2968526fb3918c2a8d3983e1ede377cd5905 (patch) | |
tree | 2e4308ec8e352756daff81632e81c195674ebdef /library | |
parent | 20d78fbba92c4ec902c12936ce608eb0536c6179 (diff) | |
download | tk-b5eb2968526fb3918c2a8d3983e1ede377cd5905.zip tk-b5eb2968526fb3918c2a8d3983e1ede377cd5905.tar.gz tk-b5eb2968526fb3918c2a8d3983e1ede377cd5905.tar.bz2 |
Add combobox -height option; only show scrollbar if the listbox
needs to scroll [#1032869].
FossilOrigin-Name: 34d9182a3e61891b26f58fbd4b7254fba1c24a6f
Diffstat (limited to 'library')
-rw-r--r-- | library/ttk/combobox.tcl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 6c7099c..5af7a2d 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -1,5 +1,5 @@ # -# $Id: combobox.tcl,v 1.2 2006/11/27 06:53:55 jenglish Exp $ +# $Id: combobox.tcl,v 1.3 2006/12/17 21:09:46 jenglish Exp $ # # Ttk widget set: combobox bindings. # @@ -275,8 +275,11 @@ proc ttk::combobox::Post {cb} { $popdown.l see $current # Should allow user to control listbox height set height [llength $values] - if {$height > 10} { - set height 10 + if {$height > [$cb cget -height]} { + set height [$cb cget -height] + grid $popdown.sb + } else { + grid remove $popdown.sb } $popdown.l configure -height $height update idletasks |