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

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

Issue 13884: IDLE 2.6.5 Recent Files undocks
Patch Set: Created 4 years, 6 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 | « Lib/idlelib/help.txt ('k') | 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 """ 1 """
2 A number of functions that enhance IDLE on Mac OSX. 2 A number of functions that enhance IDLE on Mac OSX.
3 """ 3 """
4 import sys 4 import sys
5 import Tkinter 5 import Tkinter
6 from os import path 6 from os import path
7 7
8 8
9 import warnings 9 import warnings
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 # Remove the 'About' entry from the help menu, it is in the application 140 # Remove the 'About' entry from the help menu, it is in the application
141 # menu 141 # menu
142 del Bindings.menudefs[-1][1][0:2] 142 del Bindings.menudefs[-1][1][0:2]
143 # Remove the 'Configure Idle' entry from the options menu, it is in the 143 # Remove the 'Configure Idle' entry from the options menu, it is in the
144 # application menu as 'Preferences' 144 # application menu as 'Preferences'
145 del Bindings.menudefs[-2][1][0] 145 del Bindings.menudefs[-2][1][0]
146 menubar = Menu(root) 146 menubar = Menu(root)
147 root.configure(menu=menubar) 147 root.configure(menu=menubar)
148 menudict = {} 148 menudict = {}
149 149
150 menudict['windows'] = menu = Menu(menubar, name='windows') 150 menudict['windows'] = menu = Menu(menubar, name='windows', tearoff=0)
151 menubar.add_cascade(label='Window', menu=menu, underline=0) 151 menubar.add_cascade(label='Window', menu=menu, underline=0)
152 152
153 def postwindowsmenu(menu=menu): 153 def postwindowsmenu(menu=menu):
154 end = menu.index('end') 154 end = menu.index('end')
155 if end is None: 155 if end is None:
156 end = -1 156 end = -1
157 157
158 if end > 0: 158 if end > 0:
159 menu.delete(0, end) 159 menu.delete(0, end)
160 WindowList.add_windows_to_menu(menu) 160 WindowList.add_windows_to_menu(menu)
(...skipping 19 matching lines...) Expand all
180 if flist: 180 if flist:
181 root.bind('<<close-all-windows>>', flist.close_all_callback) 181 root.bind('<<close-all-windows>>', flist.close_all_callback)
182 182
183 # The binding above doesn't reliably work on all versions of Tk 183 # The binding above doesn't reliably work on all versions of Tk
184 # on MacOSX. Adding command definition below does seem to do the 184 # on MacOSX. Adding command definition below does seem to do the
185 # right thing for now. 185 # right thing for now.
186 root.createcommand('exit', flist.close_all_callback) 186 root.createcommand('exit', flist.close_all_callback)
187 187
188 if isCarbonTk(): 188 if isCarbonTk():
189 # for Carbon AquaTk, replace the default Tk apple menu 189 # for Carbon AquaTk, replace the default Tk apple menu
190 menudict['application'] = menu = Menu(menubar, name='apple') 190 menudict['application'] = menu = Menu(menubar, name='apple',
191 tearoff=0)
191 menubar.add_cascade(label='IDLE', menu=menu) 192 menubar.add_cascade(label='IDLE', menu=menu)
192 Bindings.menudefs.insert(0, 193 Bindings.menudefs.insert(0,
193 ('application', [ 194 ('application', [
194 ('About IDLE', '<<about-idle>>'), 195 ('About IDLE', '<<about-idle>>'),
195 None, 196 None,
196 ])) 197 ]))
197 tkversion = root.tk.eval('info patchlevel') 198 tkversion = root.tk.eval('info patchlevel')
198 if tuple(map(int, tkversion.split('.'))) < (8, 4, 14): 199 if tuple(map(int, tkversion.split('.'))) < (8, 4, 14):
199 # for earlier AquaTk versions, supply a Preferences menu item 200 # for earlier AquaTk versions, supply a Preferences menu item
200 Bindings.menudefs[0][1].append( 201 Bindings.menudefs[0][1].append(
(...skipping 21 matching lines...) Expand all
222 Some one-time customizations are performed here. 223 Some one-time customizations are performed here.
223 Others are dynamically tested throughout idlelib by calls to the 224 Others are dynamically tested throughout idlelib by calls to the
224 isAquaTk(), isCarbonTk(), isCocoaTk(), isXQuartz() functions which 225 isAquaTk(), isCarbonTk(), isCocoaTk(), isXQuartz() functions which
225 are initialized here as well. 226 are initialized here as well.
226 """ 227 """
227 _initializeTkVariantTests(root) 228 _initializeTkVariantTests(root)
228 if isAquaTk(): 229 if isAquaTk():
229 hideTkConsole(root) 230 hideTkConsole(root)
230 overrideRootMenu(root, flist) 231 overrideRootMenu(root, flist)
231 addOpenEventSupport(root, flist) 232 addOpenEventSupport(root, flist)
OLDNEW
« no previous file with comments | « Lib/idlelib/help.txt ('k') | no next file » | no next file with comments »

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