summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-09-27 01:56:59 (GMT)
committertreectrl <treectrl>2006-09-27 01:56:59 (GMT)
commit95ef425a88f977fbdc0bb95d1931b1e38be036e2 (patch)
tree8c6416470233e5102cde7d1f25e3d5ef3bee2947 /demos
parent1fec66043fc6c1909497fd94c2298c26f61c92af (diff)
downloadtktreectrl-95ef425a88f977fbdc0bb95d1931b1e38be036e2.zip
tktreectrl-95ef425a88f977fbdc0bb95d1931b1e38be036e2.tar.gz
tktreectrl-95ef425a88f977fbdc0bb95d1931b1e38be036e2.tar.bz2
Nitpick.
Diffstat (limited to 'demos')
-rw-r--r--demos/explorer.tcl11
1 files changed, 6 insertions, 5 deletions
diff --git a/demos/explorer.tcl b/demos/explorer.tcl
index 4d07c81..81afaba 100644
--- a/demos/explorer.tcl
+++ b/demos/explorer.tcl
@@ -1,4 +1,4 @@
-# RCS: @(#) $Id: explorer.tcl,v 1.17 2005/07/15 01:20:52 treectrl Exp $
+# RCS: @(#) $Id: explorer.tcl,v 1.18 2006/09/27 01:56:59 treectrl Exp $
set Dir [file dirname [file dirname [info script]]]
@@ -241,23 +241,24 @@ proc ExplorerHeaderInvoke {T C} {
}
$T column configure $C -arrow $arrow -itembackground #F7F7F7
set dirCount $::TreeCtrl::Priv(DirCnt,$T)
+ set fileCount [expr {[$T item count] - 1 - $dirCount}]
set lastDir [expr {$dirCount - 1}]
switch [$T column cget $C -tag] {
name {
if {$dirCount} {
$T item sort root $order -last "root child $lastDir" -column $C -dictionary
}
- if {$dirCount < [$T item count] - 1} {
+ if {$fileCount} {
$T item sort root $order -first "root child $dirCount" -column $C -dictionary
}
}
size {
- if {$dirCount < [$T item count] - 1} {
+ if {$fileCount} {
$T item sort root $order -first "root child $dirCount" -column $C -integer -column name -dictionary
}
}
type {
- if {$dirCount < [$T item count] - 1} {
+ if {$fileCount} {
$T item sort root $order -first "root child $dirCount" -column $C -dictionary -column name -dictionary
}
}
@@ -265,7 +266,7 @@ proc ExplorerHeaderInvoke {T C} {
if {$dirCount} {
$T item sort root $order -last "root child $lastDir" -column $C -integer -column name -dictionary
}
- if {$dirCount < [$T item count] - 1} {
+ if {$fileCount} {
$T item sort root $order -first "root child $dirCount" -column $C -integer -column name -dictionary
}
}