public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* comment in managedwin.itb
@ 2000-11-28 12:47 Tom Tromey
  2000-11-28 12:54 ` Mo DeJong
  2000-11-28 13:00 ` Syd Polk
  0 siblings, 2 replies; 11+ messages in thread
From: Tom Tromey @ 2000-11-28 12:47 UTC (permalink / raw)
  To: Insight List

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <975459464.28425.ezmlm@sources.redhat.com>]

end of thread, other threads:[~2000-12-07 15:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-28 12:47 comment in managedwin.itb Tom Tromey
2000-11-28 12:54 ` Mo DeJong
2000-11-28 13:00 ` Syd Polk
2000-11-28 13:08   ` Keith Seitz
2000-11-28 13:16     ` Fernando Nasser
2000-11-28 20:17   ` Tom Tromey
2000-11-29  9:40     ` Fernando Nasser
2000-12-07 14:18       ` Fernando Nasser
2000-12-07 14:40         ` Tom Tromey
2000-12-07 15:15           ` Fernando Nasser
     [not found] <975459464.28425.ezmlm@sources.redhat.com>
2000-11-28 19:19 ` Jim Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).