diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 18:48:45 -0400 |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 18:48:45 -0400 |
commit | e84d26c61b826792f62d49cda64f1f8c76dcf55c (patch) | |
tree | 720913411be719c939a8822874330ad1dcf55be2 /Lib/idlelib/ToolTip.py | |
parent | ded3c1b83774b3ca29ec2618f4f4166c7d8e90f2 (diff) | |
parent | 1b392ffe67febbe8740520289bb828fdf060e363 (diff) | |
download | cpython-e84d26c61b826792f62d49cda64f1f8c76dcf55c.tar.gz cpython-e84d26c61b826792f62d49cda64f1f8c76dcf55c.zip |
Merge with 3.4
Diffstat (limited to 'Lib/idlelib/ToolTip.py')
-rw-r--r-- | Lib/idlelib/ToolTip.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Lib/idlelib/ToolTip.py b/Lib/idlelib/ToolTip.py index b178803b02f..e7bc81ee193 100644 --- a/Lib/idlelib/ToolTip.py +++ b/Lib/idlelib/ToolTip.py @@ -76,14 +76,21 @@ class ListboxToolTip(ToolTipBase): for item in self.items: listbox.insert(END, item) -def main(): - # Test code +def _tooltip(parent): root = Tk() - b = Button(root, text="Hello", command=root.destroy) - b.pack() - root.update() - tip = ListboxToolTip(b, ["Hello", "world"]) + 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") + label.pack() + button1 = Button(root, text="Button 1") + button2 = Button(root, text="Button 2") + button1.pack() + button2.pack() + ToolTip(button1, "This is calltip text for button1.") + ListboxToolTip(button2, ["This is","calltip text","for button2"]) root.mainloop() if __name__ == '__main__': - main() + from idlelib.idle_test.htest import run + run(_tooltip) |