Merge pull request #1764 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2019-07-31 13:29:51 -04:00 committed by GitHub
commit 5001e6dfef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3
version = __version__ = "4.1.0.17 Unreleased - Anniversary Edition"
version = __version__ = "4.1.0.18 Unreleased - Anniversary Edition"
# 888888ba .d88888b oo dP .88888. dP dP dP
@ -728,6 +728,22 @@ class Element():
"""
self.TooltipObject = ToolTip(self.Widget, text=tooltip_text, timeout=DEFAULT_TOOLTIP_TIME)
def SetFocus(self, force=False):
"""
Sets the current focus to be on this element
:param force: (bool) if True will call focus_force otherwise calls focus_set
"""
try:
if force:
self.Widget.focus_force()
else:
self.Widget.focus_set()
except:
print('Was unable to set focus. The Widget passed in was perhaps not present in this element? Check your elements .Widget property')
def __del__(self):
""" """
try:
@ -5461,8 +5477,8 @@ class Window:
return element
Element = FindElement # Shortcut function
Find = FindElement
Find = FindElement # Shortcut function, most likely not used by many people.
Elem = FindElement # NEW for 2019! More laziness... Another shortcut
def FindElementWithFocus(self):
"""