Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Side by Side Diff: Lib/idlelib/CallTipWindow.py

Issue 24570: IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18
Patch Set: Created 4 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """A CallTip window class for Tkinter/IDLE. 1 """A CallTip window class for Tkinter/IDLE.
2 2
3 After ToolTip.py, which uses ideas gleaned from PySol 3 After ToolTip.py, which uses ideas gleaned from PySol
4 Used by the CallTips IDLE extension. 4 Used by the CallTips IDLE extension.
5 """ 5 """
6 from tkinter import Toplevel, Label, LEFT, SOLID, TclError 6 from tkinter import Toplevel, Label, LEFT, SOLID, TclError
7 7
8 HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>" 8 HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
9 HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>") 9 HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
10 CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide>>" 10 CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide>>"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 # Without it, call tips intrude on the typing process by grabbing 65 # Without it, call tips intrude on the typing process by grabbing
66 # the focus. 66 # the focus.
67 tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w, 67 tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w,
68 "help", "noActivates") 68 "help", "noActivates")
69 except TclError: 69 except TclError:
70 pass 70 pass
71 self.label = Label(tw, text=self.text, justify=LEFT, 71 self.label = Label(tw, text=self.text, justify=LEFT,
72 background="#ffffe0", relief=SOLID, borderwidth=1, 72 background="#ffffe0", relief=SOLID, borderwidth=1,
73 font = self.widget['font']) 73 font = self.widget['font'])
74 self.label.pack() 74 self.label.pack()
75 tw.lift() # needed to work around bug in Tk 8.5.18+ (issue #24570)
75 76
76 self.checkhideid = self.widget.bind(CHECKHIDE_VIRTUAL_EVENT_NAME, 77 self.checkhideid = self.widget.bind(CHECKHIDE_VIRTUAL_EVENT_NAME,
77 self.checkhide_event) 78 self.checkhide_event)
78 for seq in CHECKHIDE_SEQUENCES: 79 for seq in CHECKHIDE_SEQUENCES:
79 self.widget.event_add(CHECKHIDE_VIRTUAL_EVENT_NAME, seq) 80 self.widget.event_add(CHECKHIDE_VIRTUAL_EVENT_NAME, seq)
80 self.widget.after(CHECKHIDE_TIME, self.checkhide_event) 81 self.widget.after(CHECKHIDE_TIME, self.checkhide_event)
81 self.hideid = self.widget.bind(HIDE_VIRTUAL_EVENT_NAME, 82 self.hideid = self.widget.bind(HIDE_VIRTUAL_EVENT_NAME,
82 self.hide_event) 83 self.hide_event)
83 for seq in HIDE_SEQUENCES: 84 for seq in HIDE_SEQUENCES:
84 self.widget.event_add(HIDE_VIRTUAL_EVENT_NAME, seq) 85 self.widget.event_add(HIDE_VIRTUAL_EVENT_NAME, seq)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 calltip.hidetip() 152 calltip.hidetip()
152 text.event_add("<<calltip-show>>", "(") 153 text.event_add("<<calltip-show>>", "(")
153 text.event_add("<<calltip-hide>>", ")") 154 text.event_add("<<calltip-hide>>", ")")
154 text.bind("<<calltip-show>>", calltip_show) 155 text.bind("<<calltip-show>>", calltip_show)
155 text.bind("<<calltip-hide>>", calltip_hide) 156 text.bind("<<calltip-hide>>", calltip_hide)
156 text.focus_set() 157 text.focus_set()
157 158
158 if __name__=='__main__': 159 if __name__=='__main__':
159 from idlelib.idle_test.htest import run 160 from idlelib.idle_test.htest import run
160 run(_calltip_window) 161 run(_calltip_window)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+