Skip to content

Commit

Permalink
browers.Coverer: move trace_adds later to avoid computing initial cov…
Browse files Browse the repository at this point in the history
…ers three times
  • Loading branch information
NathanDunfield committed Jan 12, 2025
1 parent 5104e15 commit b9617f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,6 @@ def __init__(self, parent, manifold):
degree_frame = ttk.Frame(top_frame)
degree_frame.grid_columnconfigure(1, weight=1)
self.degree_var = degree_var = Tk_.StringVar()
degree_var.trace_add('write', self.show_covers)
ttk.Label(degree_frame, text='Degree: ').grid(
row=0, column=0, sticky=Tk_.E)
self.degree_option = degree_option = ttk.OptionMenu(
Expand All @@ -902,7 +901,6 @@ def __init__(self, parent, manifold):
)
degree_option.grid(row=0, column=1)
self.cyclic_var = cyclic_var = Tk_.BooleanVar()
cyclic_var.trace_add('write', self.show_covers)
cyclic_or_not = ttk.Checkbutton(degree_frame,
variable=cyclic_var,
text='cyclic covers only',
Expand Down Expand Up @@ -946,6 +944,9 @@ def __init__(self, parent, manifold):
degree_var.set('2')
cyclic_var.set(True)
self.show_covers()
degree_var.trace_add('write', self.show_covers)
cyclic_var.trace_add('write', self.show_covers)


def clear_list(self, *args):
self.covers.delete(*self.covers.get_children())
Expand Down

0 comments on commit b9617f8

Please sign in to comment.