This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

comment in managedwin.itb


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]