Merge pull request #370 from MikeTheWatchGuy/Dev-latest
Changed tooltip location. New window Disable / Enable - experimental
This commit is contained in:
commit
e1d6f0cca7
|
@ -224,7 +224,7 @@ class ToolTip:
|
||||||
(inspired by https://stackoverflow.com/a/36221216)
|
(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.widget = widget
|
||||||
self.text = text
|
self.text = text
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
@ -256,7 +256,7 @@ class ToolTip:
|
||||||
if self.tipwindow:
|
if self.tipwindow:
|
||||||
return
|
return
|
||||||
x = self.widget.winfo_rootx() + 20
|
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 = tk.Toplevel(self.widget)
|
||||||
self.tipwindow.wm_overrideredirect(True)
|
self.tipwindow.wm_overrideredirect(True)
|
||||||
self.tipwindow.wm_geometry("+%d+%d" % (x, y))
|
self.tipwindow.wm_geometry("+%d+%d" % (x, y))
|
||||||
|
@ -2348,6 +2348,14 @@ class Window:
|
||||||
def OnClosingCallback(self):
|
def OnClosingCallback(self):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def Disable(self):
|
||||||
|
self.TKroot.grab_set_global()
|
||||||
|
|
||||||
|
def Enable(self):
|
||||||
|
self.TKroot.grab_release()
|
||||||
|
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue