Merge pull request #825 from MikeTheWatchGuy/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2018-12-01 18:25:30 -05:00 committed by GitHub
commit c86bab397e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 10 deletions

View file

@ -506,7 +506,7 @@ class InputText(Element):
super().__init__(ELEM_TYPE_INPUT_TEXT, size=size, background_color=bg, text_color=fg, key=key, pad=pad,
font=font, tooltip=tooltip)
def Update(self, value=None, disabled=None):
def Update(self, value=None, disabled=None, select=None):
if disabled is True:
self.TKEntry['state'] = 'disabled'
elif disabled is False:
@ -517,6 +517,9 @@ class InputText(Element):
except:
pass
self.DefaultText = value
if select:
self.TKEntry.select_range(0, 'end')
def Get(self):
try:
@ -2974,6 +2977,7 @@ class Window:
self.DisableClose = disable_close
self._Hidden = False
self._Size = size
self.XFound = False
# ------------------------- Add ONE Row to Form ------------------------- #
def AddRow(self, *args):
@ -3132,7 +3136,7 @@ class Window:
# print("** REALTIME PROBLEM FOUND **", results)
if self.RootNeedsDestroying:
# print('*** DESTROYING really late***')
print('*** DESTROYING really late***')
self.TKroot.destroy()
# _my_windows.Decrement()
self.LastButtonClicked = None
@ -3173,6 +3177,12 @@ class Window:
self.LastButtonClicked = None
return results
else:
if not self.XFound and self.Timeout != 0 and self.Timeout is not None and self.ReturnValues[
0] is None: # Special Qt case because returning for no reason so fake timeout
self.ReturnValues = self.TimeoutKey, self.ReturnValues[1] # fake a timeout
elif not self.XFound and self.ReturnValues[0] is None: # TODO HIGHLY EXPERIMENTAL... added due to tray icon interaction
# print("*** Faking timeout ***")
self.ReturnValues = self.TimeoutKey, self.ReturnValues[1] # fake a timeout
return self.ReturnValues
def ReadNonBlocking(self):
@ -3353,6 +3363,7 @@ class Window:
# print('Got closing callback', self.DisableClose)
if self.DisableClose:
return
self.XFound = True
if self.CurrentlyRunningMainloop: # quit if this is the current mainloop, otherwise don't quit!
self.TKroot.quit() # kick the users out of the mainloop
self.TKroot.destroy() # kick the users out of the mainloop