mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-04-23 04:20:26 +03:00
Fixed Tk state being accessed in a thread
This commit is contained in:
parent
79271aa607
commit
c27d74ef01
@ -76,11 +76,12 @@ class AutoCompleter(Entry, PlaceHolder):
|
||||
|
||||
def changed(self, name, index, mode):
|
||||
self.set_default_style()
|
||||
if self.var.get().__len__() < 3 and self.lb_up or self.has_selected:
|
||||
value = self.var.get()
|
||||
if value.__len__() < 3 and self.lb_up or self.has_selected:
|
||||
self.hide_list()
|
||||
self.has_selected = False
|
||||
else:
|
||||
t = threading.Thread(target=self.query_systems)
|
||||
t = threading.Thread(target=self.query_systems, args=[value])
|
||||
t.start()
|
||||
|
||||
def selection(self, event=None):
|
||||
@ -143,8 +144,8 @@ class AutoCompleter(Entry, PlaceHolder):
|
||||
self.lb.grid_remove()
|
||||
self.lb_up = False
|
||||
|
||||
def query_systems(self):
|
||||
inp = self.var.get().strip()
|
||||
def query_systems(self, inp):
|
||||
inp = inp.strip()
|
||||
if inp != self.placeholder and inp.__len__() >= 3:
|
||||
url = "https://spansh.co.uk/api/systems?"
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user