Improve handling of <Destroy>
event in TopLevelDialogs
#683
Labels
code improvement
Improve maintainability, consistency, etc
<Destroy>
event in TopLevelDialogs
#683
While reviewing #579, I noticed that the
<Destroy>
event was bound to thetop_frame
instead of the dialog. Further investigation reveals that this avoids the problem of the bound method being called once for every widget in the dialog (explanation below for future reference).Suggestion:
tidy_up
toself.top_frame
rather thanself
tidy_up
there's no longer any need to check the widget class, since it will just be called oncecheckers.py
, thetidy_up
method doesn't need to check widget class (Also fix comment at top of method)tidy_up
to something withdestroy
in itsearch.py
(once Showing all matches during a search #579 is merged), instead of binding todestroy
, override thetidy_up
method (like checkers.py)Explanation of difference between binding to dialog and binding to
top_frame
:(Taken from here)
top_frame
(not a toplevel window) into the binding routine, it only matches the "itself" tag of thetop_frame
widget.my_dialog
(a toplevel window), it matches not only the "itself" tag of themy_dialog
widget, but also thetoplevel window
tag of all of its child widgets. So, you appear to have bound your method to the dialog and all its children.The text was updated successfully, but these errors were encountered: