summaryrefslogtreecommitdiffstats
path: root/library/ttk/utils.tcl
diff options
context:
space:
mode:
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*