My application runs this code at startup among other things:
set ::WidgetThatHasFocusNow [focus]
if {[string length $::WidgetThatHasFocusNow] <= 0} {
puts "focus is on [focus]"
}
output:
focus is on
That means no widget has focus at startup.
So I fixes it.
set WidgetThatHasFocusNow [focus]
if {[string length $::WidgetThatHasFocusNow] <= 0} {
focus -force $::FileListColumn
event generate $::FileListColumn <Up>
puts "focus is on [focus]"
} else {puts Eureka!}
output:
focus is on
No, it still doesn't work. :-(
But I also have this:
bind $::FileListColumn <Key> {after idle [list p.Update.Widgets.On.Any.Action %K]}
That prints/inserts the output of [focus] on a widget I keep around for debugging.
So that widget gets focus when I press any key, but not until then in spite of my efforts.
How can I force focus at startup programatically?
TIA
--
Luc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)