summaryrefslogtreecommitdiffstats
path: root/library/ttk/utils.tcl
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-11-07 03:45:27 (GMT)
committerjenglish <jenglish@flightlab.com>2006-11-07 03:45:27 (GMT)
commit643b19451d3b2bd1e080733c4c93c5a9daaad63a (patch)
tree8067b063a85bcd662fa0771dc6b6ab068aa3f9f3 /library/ttk/utils.tcl
parent4e674e6b1ec465975a7138542ed175cc6f9acda3 (diff)
downloadtk-643b19451d3b2bd1e080733c4c93c5a9daaad63a.zip
tk-643b19451d3b2bd1e080733c4c93c5a9daaad63a.tar.gz
tk-643b19451d3b2bd1e080733c4c93c5a9daaad63a.tar.bz2
Miscellaneous minor changes to re-sync Ttk codebase with Tile CVS:
fix comments damaged by overzealous search-and-destroy; removed obsolete [style default] synonym for [ttk::style configure]; removed other dead code.
Diffstat (limited to 'library/ttk/utils.tcl')
-rw-r--r--library/ttk/utils.tcl38
1 files changed, 19 insertions, 19 deletions
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index b8059ae..11f85b9 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -1,5 +1,5 @@
#
-# $Id: utils.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
+# $Id: utils.tcl,v 1.2 2006/11/07 03:45:28 jenglish Exp $
#
# Ttk widget set: utilities for widget implementations.
#
@@ -58,6 +58,24 @@ proc ttk::takesFocus {w} {
return 0
}
+# ttk::focusFirst $w --
+# Return the first descendant of $w, in preorder traversal order,
+# that can take keyboard focus, "" if none do.
+#
+# See also: tk_focusNext
+#
+proc ttk::focusFirst {w} {
+ if {[ttk::takesFocus $w]} {
+ return $w
+ }
+ foreach child [winfo children $w] {
+ if {[set c [ttk::focusFirst $child]] ne ""} {
+ return $c
+ }
+ }
+ return ""
+}
+
### Grabs.
#
# Rules:
@@ -213,22 +231,4 @@ proc ttk::CopyBindings {from to} {
}
}
-## ttk::LoadImages $imgdir ?$patternList? --
-# Utility routine for pixmap themes
-#
-# Loads all image files in $imgdir matching $patternList.
-# Returns: a paired list of filename/imagename pairs.
-#
-proc ttk::LoadImages {imgdir {patterns {*.gif}}} {
- foreach pattern $patterns {
- foreach file [glob -directory $imgdir $pattern] {
- set img [file tail [file rootname $file]]
- if {![info exists images($img)]} {
- set images($img) [image create photo -file $file]
- }
- }
- }
- return [array get images]
-}
-
#*EOF*