Merge pull request #268 from MikeTheWatchGuy/Dev-latest

Button Targets can be keys along with (row,col).
This commit is contained in:
MikeTheWatchGuy 2018-09-19 13:02:59 -04:00 committed by GitHub
commit 06306636e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -959,9 +959,12 @@ class Button(Element):
if target == (None, None):
strvar = self.TKStringVar
else:
if target[0] < 0:
target = [self.Position[0] + target[0], target[1]]
target_element = self.ParentForm._GetElementAtLocation(target)
if len(target) == 2:
if target[0] < 0:
target = [self.Position[0] + target[0], target[1]]
target_element = self.ParentForm._GetElementAtLocation(target)
else:
target_element = self.ParentForm.FindElement(target)
try:
strvar = target_element.TKStringVar
except: pass