summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/tooltip.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-07-10 21:28:10 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-07-10 21:28:10 (GMT)
commita748032653aec69596257f59f27d8e1945fece9d (patch)
tree25d06528db043b0e0039f5a1de73d60e304518cd /Lib/idlelib/tooltip.py
parentcd5e388c39563c7bd1122ec3360fd5ed60952668 (diff)
downloadcpython-a748032653aec69596257f59f27d8e1945fece9d.zip
cpython-a748032653aec69596257f59f27d8e1945fece9d.tar.gz
cpython-a748032653aec69596257f59f27d8e1945fece9d.tar.bz2
Refine geometry of idlelib htests (and a few other fix-ups).
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