This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
comment in managedwin.itb
- To: Insight List <insight at sourceware dot cygnus dot com>
- Subject: comment in managedwin.itb
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 28 Nov 2000 13:57:11 -0700
- Reply-To: tromey at cygnus dot com
I see this code in managedwin.itb:
# I don't understand this next line and no one commented it, so it's gone.
#focus -force [focus -lastfor $top]
focus $top
I think I probably wrote the commented-out code. Finding who
commented it out was annoying (most copies of the code in CVS were
made by people who obviously weren't the author), but I think it was
Jim Ingham.
Either I didn't comment this because I thought it was an idiom (I did
document it in my Tcl style guide), or because we were under a lot of
time pressure, or both.
The basic idea here is that `focus $top' sets the focus window to $top
-- but if the focus was previously on a subwindow of $top, then this
information is lost.
The idiom `focus -force [focus -lastfor $top]' causes us to force the
focus to change, but also lets us preserve the focus inside the
window.
Using -force is relatively unfriendly though. I think we were doing
that everywhere at the time because we were targeting Windows, and
that seems to be the sort of thing one does there.
As it stands now I think the comment and the existing focus command in
that proc could be removed. Comments on this?
Tom