def open_win(self, _=None, force_open=False): if self._readonly and not force_open: TK_ROOT.bell() return 'break' # Tell tk to stop processing this event self.win.deiconify() self.win.lift(self.parent) self.win.grab_set() self.win.focus_force() # Focus here to deselect the textbox utils.center_win(self.win, parent=self.parent) self.flow_items() self.sel_item(self.selected)