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

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

Issue 13884: IDLE 2.6.5 Recent Files undocks
Patch Set: Created 4 years, 8 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 | Lib/idlelib/help.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import sys 1 import sys
2 import os 2 import os
3 import platform 3 import platform
4 import re 4 import re
5 import imp 5 import imp
6 from Tkinter import * 6 from Tkinter import *
7 import tkSimpleDialog 7 import tkSimpleDialog
8 import tkMessageBox 8 import tkMessageBox
9 import webbrowser 9 import webbrowser
10 10
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 per.insertfilter(undo) 309 per.insertfilter(undo)
310 text.undo_block_start = undo.undo_block_start 310 text.undo_block_start = undo.undo_block_start
311 text.undo_block_stop = undo.undo_block_stop 311 text.undo_block_stop = undo.undo_block_stop
312 undo.set_saved_change_hook(self.saved_change_hook) 312 undo.set_saved_change_hook(self.saved_change_hook)
313 313
314 # IOBinding implements file I/O and printing functionality 314 # IOBinding implements file I/O and printing functionality
315 self.io = io = self.IOBinding(self) 315 self.io = io = self.IOBinding(self)
316 io.set_filename_change_hook(self.filename_change_hook) 316 io.set_filename_change_hook(self.filename_change_hook)
317 317
318 # Create the recent files submenu 318 # Create the recent files submenu
319 self.recent_files_menu = Menu(self.menubar) 319 self.recent_files_menu = Menu(self.menubar, tearoff=0)
320 self.menudict['file'].insert_cascade(3, label='Recent Files', 320 self.menudict['file'].insert_cascade(3, label='Recent Files',
321 underline=0, 321 underline=0,
322 menu=self.recent_files_menu) 322 menu=self.recent_files_menu)
323 self.update_recent_files_list() 323 self.update_recent_files_list()
324 324
325 self.color = None # initialized below in self.ResetColorizer 325 self.color = None # initialized below in self.ResetColorizer
326 if filename: 326 if filename:
327 if os.path.exists(filename) and not os.path.isdir(filename): 327 if os.path.exists(filename) and not os.path.isdir(filename):
328 io.loadfile(filename) 328 io.loadfile(filename)
329 else: 329 else:
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 ("windows", "_Window"), 470 ("windows", "_Window"),
471 ("help", "_Help"), 471 ("help", "_Help"),
472 ] 472 ]
473 473
474 474
475 def createmenubar(self): 475 def createmenubar(self):
476 mbar = self.menubar 476 mbar = self.menubar
477 self.menudict = menudict = {} 477 self.menudict = menudict = {}
478 for name, label in self.menu_specs: 478 for name, label in self.menu_specs:
479 underline, label = prepstr(label) 479 underline, label = prepstr(label)
480 menudict[name] = menu = Menu(mbar, name=name) 480 menudict[name] = menu = Menu(mbar, name=name, tearoff=0)
481 mbar.add_cascade(label=label, menu=menu, underline=underline) 481 mbar.add_cascade(label=label, menu=menu, underline=underline)
482 482
483 if macosxSupport.isCarbonTk(): 483 if macosxSupport.isCarbonTk():
484 # Insert the application menu 484 # Insert the application menu
485 menudict['application'] = menu = Menu(mbar, name='apple') 485 menudict['application'] = menu = Menu(mbar, name='apple',
486 tearoff=0)
486 mbar.add_cascade(label='IDLE', menu=menu) 487 mbar.add_cascade(label='IDLE', menu=menu)
487 488
488 self.fill_menus() 489 self.fill_menus()
489 self.base_helpmenu_length = self.menudict['help'].index(END) 490 self.base_helpmenu_length = self.menudict['help'].index(END)
490 self.reset_help_menu_entries() 491 self.reset_help_menu_entries()
491 492
492 def postwindowsmenu(self): 493 def postwindowsmenu(self):
493 # Only called when Windows menu exists 494 # Only called when Windows menu exists
494 menu = self.menudict['windows'] 495 menu = self.menudict['windows']
495 end = menu.index("end") 496 end = menu.index("end")
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 macosxSupport.setupApp(root, None) 1722 macosxSupport.setupApp(root, None)
1722 edit = EditorWindow(root=root, filename=filename) 1723 edit = EditorWindow(root=root, filename=filename)
1723 edit.text.bind("<<close-all-windows>>", edit.close_event) 1724 edit.text.bind("<<close-all-windows>>", edit.close_event)
1724 # Does not stop error, neither does following 1725 # Does not stop error, neither does following
1725 # edit.text.bind("<<close-window>>", edit.close_event) 1726 # edit.text.bind("<<close-window>>", edit.close_event)
1726 1727
1727 1728
1728 if __name__ == '__main__': 1729 if __name__ == '__main__':
1729 from idlelib.idle_test.htest import run 1730 from idlelib.idle_test.htest import run
1730 run(_help_dialog, _editor_window) 1731 run(_help_dialog, _editor_window)
OLDNEW
« no previous file with comments | « no previous file | Lib/idlelib/help.txt » ('j') | no next file with comments »

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