diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2002-12-12 19:15:39 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2002-12-12 19:15:39 (GMT) |
commit | e54710bd726fdc6ea46e7fbd1f153a92dc43f2b6 (patch) | |
tree | fe4c0a415fb74a17ca0643afe60ab5962466370e /Lib/idlelib/CallTipWindow.py | |
parent | 7e5c6a02eba1a6f5e93bfa1241ceff39bec9f3c9 (diff) | |
download | cpython-e54710bd726fdc6ea46e7fbd1f153a92dc43f2b6.zip cpython-e54710bd726fdc6ea46e7fbd1f153a92dc43f2b6.tar.gz cpython-e54710bd726fdc6ea46e7fbd1f153a92dc43f2b6.tar.bz2 |
M CallTipWindow.py
M CallTips.py
Calltip fetch was erroring when an Edit window was used without a Shell.
Also, fix CallTipWindow.py so test code will run and add a comment about a
bug which causes the calltip window to override all others.
Diffstat (limited to 'Lib/idlelib/CallTipWindow.py')
-rw-r--r-- | Lib/idlelib/CallTipWindow.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/CallTipWindow.py index 1542fe7..d089a87 100644 --- a/Lib/idlelib/CallTipWindow.py +++ b/Lib/idlelib/CallTipWindow.py @@ -1,7 +1,9 @@ -# A CallTip window class for Tkinter/IDLE. -# After ToolTip.py, which uses ideas gleaned from PySol +"""A CallTip window class for Tkinter/IDLE. -# Used by the CallTips IDLE extension. +After ToolTip.py, which uses ideas gleaned from PySol +Used by the CallTips IDLE extension. + +""" from Tkinter import * class CallTip: @@ -13,13 +15,11 @@ class CallTip: self.x = self.y = 0 def showtip(self, text): - # SF bug 546078: IDLE calltips cause application error. - # There were crashes on various Windows flavors, and even a - # crashing X server on Linux, with very long calltips. + " Display text in calltip window" + # truncate overly long calltip if len(text) >= 79: text = text[:75] + ' ...' self.text = text - if self.tipwindow or not self.text: return self.widget.see("insert") @@ -27,6 +27,10 @@ class CallTip: x = x + self.widget.winfo_rootx() + 2 y = y + cy + self.widget.winfo_rooty() self.tipwindow = tw = Toplevel(self.widget) + # XXX 12 Dec 2002 KBK The following command has two effects: It removes + # the calltip window border (good) but also causes (at least on + # Linux) the calltip to show as a top level window, burning through + # any other window dragged over it. Also, shows on all viewports! tw.wm_overrideredirect(1) tw.wm_geometry("+%d+%d" % (x, y)) try: @@ -68,7 +72,7 @@ class container: # Conceptually an editor_window text.bind("<<calltip-hide>>", self.calltip_hide) text.focus_set() - # root.mainloop() # not in idle + root.mainloop() def calltip_show(self, event): self.calltip.showtip("Hello world") |