color_config(text)
text.focus_set()
- self.button_ok = button_ok = Button(
+ self.button_ok = Button(
self, text='Close', command=self.ok, takefocus=False)
self.textframe.pack(side='top', expand=True, fill='both')
- button_ok.pack(side='bottom')
+ self.button_ok.pack(side='bottom')
def ok(self, event=None):
"""Dismiss text viewer dialog."""
self.geometry(f'=750x500+{x}+{y}')
self.title(title)
- self.viewframe = ViewFrame(self, contents, wrap=wrap)
self.protocol("WM_DELETE_WINDOW", self.ok)
- self.button_ok = Button(self, text='Close',
- command=self.ok, takefocus=False)
+ self.viewframe = ViewFrame(self, contents, wrap=wrap)
self.viewframe.pack(side='top', expand=True, fill='both')
self.is_modal = modal