From ed2e8278356d18cb4b57015b96d1495e0a7f471c Mon Sep 17 00:00:00 2001
From: treectrl
+Each value-stateList pair is checked in order from left to right. The value
+associated with the first stateList that matches the current item state is
+used. So stateLists should be listed from most-specific to least-specific.
+
+$T element configure MyRectElement -fill {gray {selected} blue {selected focus}}
+
+A value followed by an empty stateList should always be last since it will be +chosen regardless of the item's state.
diff --git a/doc/treectrl.man b/doc/treectrl.man index 1723088..a1ce326 100644 --- a/doc/treectrl.man +++ b/doc/treectrl.man @@ -3,7 +3,7 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - $Id: treectrl.man,v 1.50 2007/02/06 22:27:35 treectrl Exp $} + $Id: treectrl.man,v 1.51 2007/10/23 23:04:33 treectrl Exp $} ][manpage_begin treectrl n 2.2.3] [moddesc {Tk Commands}] [titledesc {Create and manipulate hierarchical multicolumn widgets}] @@ -2652,6 +2652,19 @@ In the example above, the [const rect] element is filled with blue when the tree has the focus and the item is selected. If the treectrl does not have the focus, the example specifies that gray should be used for selected items. Also note that if the item is not selected, no color is specified for the -fill option. +[para] +Each value-stateList pair is checked in order from left to right. The value +associated with the first stateList that matches the current item state is +used. So stateLists should be listed from most-specific to least-specific. +[example_begin] +$T element configure MyRectElement -fill {gray {selected} blue {selected focus}} +[example_end] +Written this way, gray will always be used for selected items since +it appears first, and blue will never be used for selected items regardless +of the focus. +[para] +A value followed by an empty stateList should always be last since it will be +chosen regardless of the item's state. [section ELEMENTS] Elements are the smallest building blocks diff --git a/doc/treectrl.n b/doc/treectrl.n index 8359a07..932421f 100644 --- a/doc/treectrl.n +++ b/doc/treectrl.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" $Id: treectrl.n,v 1.67 2007/02/06 22:27:35 treectrl Exp $ +'\" $Id: treectrl.n,v 1.68 2007/10/23 23:04:33 treectrl Exp $ .so man.macros .TH "treectrl" n 2.2.3 treectrl "Tk Commands" .BS @@ -3185,6 +3185,21 @@ In the example above, the \fBrect\fR element is filled with blue when the treect has the focus and the item is selected. If the treectrl does not have the focus, the example specifies that gray should be used for selected items. Also note that if the item is not selected, no color is specified for the -fill option. +.PP +Each value-stateList pair is checked in order from left to right. The value +associated with the first stateList that matches the current item state is +used. So stateLists should be listed from most-specific to least-specific. +.nf + +$T element configure MyRectElement -fill {gray {selected} blue {selected focus}} + +.fi +Written this way, gray will always be used for selected items since +it appears first, and blue will never be used for selected items regardless +of the focus. +.PP +A value followed by an empty stateList should always be last since it will be +chosen regardless of the item's state. .SH ELEMENTS Elements are the smallest building blocks which are handled by a treectrl widget. -- cgit v0.12