|
Prev: Tcl-URL! - weekly Tcl news and links (Jul 2)
Next: Tcl-URL! - weekly Tcl news and links (Jul 2)
From: kwizzz on 2 Jul 2008 12:37 Dear fellow Tclers, Just a tiny, but very annoying, problem that I encounter every time when I execute a Tcl application with Tk on Windows (doesn't matter if it is double clicked in explorer or executed via cmd.exe): the window focus gets lost.. Take the following script: package require Tk label .l -text "Focus test on $tcl_platform(os) Under Windows, the newly created window does not get the focus" button .quit -text Quit -command exit pack .l .quit focus .quit bind .quit <Return> {.quit invoke} On Unix, the new Tk window gets the main focus (title bar is highlighted) and the Quit button has input focus. However, on Windows, no main focus, first I have to click on the title bar in order to get the input focus. Tcl is 8.5.2 from ActiveState (on Windows) and regular 8.5.2 (apt) e.g. on my Ubuntu system. My Windows is a standard Windows XP with latest Service Packs. Any hints? TIA, Chris
From: Óscar Fuentes on 2 Jul 2008 17:27 "kwizzz(a)googlemail.com" <kwizzz(a)googlemail.com> writes: > Any hints? Try focus -force .quit -- Oscar
From: Sergio Anis on 3 Jul 2008 10:52 I read somewhere that this is the normal behavior on Windows and Mac. When you execute a program, the windows manager keeps the focus until you explicitly give it to that program. As far as I understand this is how the OS works. Sergio
From: keithv on 3 Jul 2008 12:34 On Jul 3, 10:52 am, Sergio Anis <sergioa...(a)gmail.com> wrote: > I read somewhere that this is the normal behavior on Windows and Mac. > When you execute a program, the windows manager keeps the focus until > you explicitly give it to that program. > As far as I understand this is how the OS works. > > Sergio This was done to prevent the problem of where you're typing away and suddenly another window pops up and grabs the focus. If you don't realize this has happened all your subsequent typing gets lost. Keith
From: Gerald W. Lester on 3 Jul 2008 12:39 keithv wrote: > On Jul 3, 10:52 am, Sergio Anis <sergioa...(a)gmail.com> wrote: >> I read somewhere that this is the normal behavior on Windows and Mac. >> When you execute a program, the windows manager keeps the focus until >> you explicitly give it to that program. >> As far as I understand this is how the OS works. >> >> Sergio > > This was done to prevent the problem of where you're typing > away and suddenly another window pops up and grabs the focus. > If you don't realize this has happened all your subsequent > typing gets lost. Note that you can override it (with after and focus -force) but it is considered very rude. -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+
|
Next
|
Last
Pages: 1 2 3 Prev: Tcl-URL! - weekly Tcl news and links (Jul 2) Next: Tcl-URL! - weekly Tcl news and links (Jul 2) |