summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/tooltip.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/tooltip.py')
-rw-r--r--Lib/idlelib/tooltip.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/Lib/idlelib/tooltip.py b/Lib/idlelib/tooltip.py
index c3eafed..843fb4a 100644
--- a/Lib/idlelib/tooltip.py
+++ b/Lib/idlelib/tooltip.py
@@ -77,20 +77,19 @@ class ListboxToolTip(ToolTipBase):
listbox.insert(END, item)
def _tooltip(parent): # htest #
- root = Tk()
- root.title("Test tooltip")
- width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
- root.geometry("+%d+%d"%(x, y + 150))
- label = Label(root, text="Place your mouse over buttons")
+ top = Toplevel(parent)
+ top.title("Test tooltip")
+ x, y = map(int, parent.geometry().split('+')[1:])
+ top.geometry("+%d+%d" % (x, y + 150))
+ label = Label(top, text="Place your mouse over buttons")
label.pack()
- button1 = Button(root, text="Button 1")
- button2 = Button(root, text="Button 2")
+ button1 = Button(top, text="Button 1")
+ button2 = Button(top, text="Button 2")
button1.pack()
button2.pack()
ToolTip(button1, "This is tooltip text for button1.")
ListboxToolTip(button2, ["This is","multiple line",
"tooltip text","for button2"])
- root.mainloop()
if __name__ == '__main__':
from idlelib.idle_test.htest import run