Changed tooltip location. New window Disable / Enable - experimental

This commit is contained in:
MikeTheWatchGuy 2018-09-27 21:31:05 -04:00
parent 1c817fe419
commit 83e9c58904
1 changed files with 10 additions and 2 deletions

View File

@ -224,7 +224,7 @@ class ToolTip:
(inspired by https://stackoverflow.com/a/36221216)
"""
def __init__(self, widget, text, timeout=1000):
def __init__(self, widget, text, timeout=DEFAULT_TOOLTIP_TIME):
self.widget = widget
self.text = text
self.timeout = timeout
@ -256,7 +256,7 @@ class ToolTip:
if self.tipwindow:
return
x = self.widget.winfo_rootx() + 20
y = self.widget.winfo_rooty() + self.widget.winfo_height() + 1
y = self.widget.winfo_rooty() + self.widget.winfo_height() - 20
self.tipwindow = tk.Toplevel(self.widget)
self.tipwindow.wm_overrideredirect(True)
self.tipwindow.wm_geometry("+%d+%d" % (x, y))
@ -2348,6 +2348,14 @@ class Window:
def OnClosingCallback(self):
return
def Disable(self):
self.TKroot.grab_set_global()
def Enable(self):
self.TKroot.grab_release()
def __enter__(self):
return self