summaryrefslogtreecommitdiffstats
path: root/library/ttk/treeview.tcl
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-12-18 19:33:10 (GMT)
committerjenglish <jenglish@flightlab.com>2006-12-18 19:33:10 (GMT)
commitfb835826dd21c44784539b40e590866ffb89bd93 (patch)
treeb0a6aa116ab0a8f8f7eefc79d7816eb5eb6e5c58 /library/ttk/treeview.tcl
parent16cde6f4aaf0d168843b71218b3b76cad1f1da4c (diff)
downloadtk-fb835826dd21c44784539b40e590866ffb89bd93.zip
tk-fb835826dd21c44784539b40e590866ffb89bd93.tar.gz
tk-fb835826dd21c44784539b40e590866ffb89bd93.tar.bz2
Big batch of ttk::treeview improvements:
Added column '-stretch' and '-minwidth' options. Improved column drag and resize behavior. Added horizontal scrolling [#1518650]. Row height and child indent specifiable on Treeview style. Decreased default row height, no default -padding. Use correct heading height [#1163349]. Apply tag settings to tree item as well as to data columns [NOTE: 'tag configure' still buggy]. Fix off-by-one condition when moving nodes forward [#1618142] Prevent overscroll ([#1173434]) Treeview style settings specified separately in each theme. Added disclosure triangle element in aqua theme.
Diffstat (limited to 'library/ttk/treeview.tcl')
-rw-r--r--library/ttk/treeview.tcl47
1 files changed, 3 insertions, 44 deletions
diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl
index 265f34c..3ccb746 100644
--- a/library/ttk/treeview.tcl
+++ b/library/ttk/treeview.tcl
@@ -1,7 +1,6 @@
+# $Id: treeview.tcl,v 1.2 2006/12/18 19:33:14 jenglish Exp $
#
-# $Id: treeview.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
-#
-# Ttk widget set -- bindings for Treeview widget.
+# ttk::treeview widget bindings and utilities.
#
namespace eval ttk::treeview {
@@ -18,9 +17,7 @@ namespace eval ttk::treeview {
set State(pressX) 0
# For pressMode == "resize"
- set State(minWidth) 24
set State(resizeColumn) #0
- set State(resizeWidth) 0
# For pressmode == "heading"
set State(heading) {}
@@ -217,24 +214,15 @@ proc ttk::treeview::Release {w x y} {
### Interactive column resizing.
#
-# @@@ needs work.
-#
proc ttk::treeview::resize.press {w x column} {
variable State
-
set State(pressMode) "resize"
- set State(pressX) $x
set State(resizeColumn) $column
- set State(resizeWidth) [$w column $column -width]
}
proc ttk::treeview::resize.drag {w x} {
variable State
- set newWidth [expr {$State(resizeWidth) + $x - $State(pressX)}]
- if {$newWidth < $State(minWidth)} {
- set newWidth $State(minWidth)
- }
- $w column $State(resizeColumn) -width $newWidth
+ $w drag $State(resizeColumn) $x
}
proc ttk::treeview::resize.release {w x} {
@@ -391,33 +379,4 @@ proc ttk::treeview::BrowseTo {w item} {
$w selection set [list $item]
}
-### Style settings for selected built-in themes.
-#
-# Do this here instead of in the theme definitions since the details are
-# likely to change; it's better to keep this all in one place for now.
-#
-namespace eval ::ttk::treeview {
- variable theme
- namespace import -force ::ttk::style
- foreach theme [style theme names] {
- style theme settings $theme {
- style map Item -foreground [list selected "#FFFFFF"]
- style configure Row -background "#EEEEEE"
- style configure Heading -relief raised -font TkHeadingFont
- style configure Item -justify left
- style map Heading -relief {
- pressed sunken
- }
- style map Row -background {
- selected #4a6984
- focus #ccccff
- alternate #FFFFFF
- }
- style map Cell -foreground {
- selected #FFFFFF
- }
- }
- }
-}
-
#*EOF*