mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #13884: Idle: Remove tearoff lines from menus. Patch by Roger Serwy.
This commit is contained in:
parent
41ca828580
commit
30f1f67248
4 changed files with 8 additions and 10 deletions
|
@ -37,8 +37,6 @@ context menu.
|
||||||
|
|
||||||
IDLE's menus dynamically change based on which window is currently selected.
|
IDLE's menus dynamically change based on which window is currently selected.
|
||||||
Each menu documented below indicates which window type it is associated with.
|
Each menu documented below indicates which window type it is associated with.
|
||||||
Click on the dotted line at the top of a menu to "tear it off": a separate
|
|
||||||
window containing the menu is created (for Unix and Windows only).
|
|
||||||
|
|
||||||
File menu (Shell and Editor)
|
File menu (Shell and Editor)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -447,14 +447,15 @@ class EditorWindow(object):
|
||||||
self.menudict = menudict = {}
|
self.menudict = menudict = {}
|
||||||
for name, label in self.menu_specs:
|
for name, label in self.menu_specs:
|
||||||
underline, label = prepstr(label)
|
underline, label = prepstr(label)
|
||||||
menudict[name] = menu = Menu(mbar, name=name)
|
menudict[name] = menu = Menu(mbar, name=name, tearoff=0)
|
||||||
mbar.add_cascade(label=label, menu=menu, underline=underline)
|
mbar.add_cascade(label=label, menu=menu, underline=underline)
|
||||||
if macosxSupport.isCarbonTk():
|
if macosxSupport.isCarbonTk():
|
||||||
# Insert the application menu
|
# Insert the application menu
|
||||||
menudict['application'] = menu = Menu(mbar, name='apple')
|
menudict['application'] = menu = Menu(mbar, name='apple',
|
||||||
|
tearoff=0)
|
||||||
mbar.add_cascade(label='IDLE', menu=menu)
|
mbar.add_cascade(label='IDLE', menu=menu)
|
||||||
self.fill_menus()
|
self.fill_menus()
|
||||||
self.recent_files_menu = Menu(self.menubar)
|
self.recent_files_menu = Menu(self.menubar, tearoff=0)
|
||||||
self.menudict['file'].insert_cascade(3, label='Recent Files',
|
self.menudict['file'].insert_cascade(3, label='Recent Files',
|
||||||
underline=0,
|
underline=0,
|
||||||
menu=self.recent_files_menu)
|
menu=self.recent_files_menu)
|
||||||
|
|
|
@ -15,9 +15,7 @@ Menus:
|
||||||
IDLE has two window types the Shell window and the Editor window. It is
|
IDLE has two window types the Shell window and the Editor window. It is
|
||||||
possible to have multiple editor windows simultaneously. IDLE's
|
possible to have multiple editor windows simultaneously. IDLE's
|
||||||
menus dynamically change based on which window is currently selected. Each menu
|
menus dynamically change based on which window is currently selected. Each menu
|
||||||
documented below indicates which window type it is associated with. Click on
|
documented below indicates which window type it is associated with.
|
||||||
the dotted line at the top of a menu to "tear it off": a separate window
|
|
||||||
containing the menu is created (for Unix and Windows only).
|
|
||||||
|
|
||||||
File Menu (Shell and Editor):
|
File Menu (Shell and Editor):
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ def overrideRootMenu(root, flist):
|
||||||
root.configure(menu=menubar)
|
root.configure(menu=menubar)
|
||||||
menudict = {}
|
menudict = {}
|
||||||
|
|
||||||
menudict['windows'] = menu = Menu(menubar, name='windows')
|
menudict['windows'] = menu = Menu(menubar, name='windows', tearoff=0)
|
||||||
menubar.add_cascade(label='Window', menu=menu, underline=0)
|
menubar.add_cascade(label='Window', menu=menu, underline=0)
|
||||||
|
|
||||||
def postwindowsmenu(menu=menu):
|
def postwindowsmenu(menu=menu):
|
||||||
|
@ -191,7 +191,8 @@ def overrideRootMenu(root, flist):
|
||||||
|
|
||||||
if isCarbonTk():
|
if isCarbonTk():
|
||||||
# for Carbon AquaTk, replace the default Tk apple menu
|
# for Carbon AquaTk, replace the default Tk apple menu
|
||||||
menudict['application'] = menu = Menu(menubar, name='apple')
|
menudict['application'] = menu = Menu(menubar, name='apple',
|
||||||
|
tearoff=0)
|
||||||
menubar.add_cascade(label='IDLE', menu=menu)
|
menubar.add_cascade(label='IDLE', menu=menu)
|
||||||
Bindings.menudefs.insert(0,
|
Bindings.menudefs.insert(0,
|
||||||
('application', [
|
('application', [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue