Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite163e8d

Browse files
Xiaokang2022ZeroIntensityterryjreedy
authored
gh-128062: Fix the font size and shortcut display of the turtledemo menu (#128063)
Leave the font of the menu bar the default to keep it consistent with the rest of the world. Display the shortcut keys in the right way, using the 'accelerator' option.---------Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
1 parent1b15c89 commite163e8d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎Lib/turtledemo/__main__.py‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
DONE=4
106106
EVENTDRIVEN=5
107107

108-
menufont= ("Arial",12,NORMAL)
109108
btnfont= ("Arial",12,'bold')
110109
txtfont= ['Lucida Console',10,'normal']
111110

@@ -297,23 +296,21 @@ def makeLoadDemoMenu(self, master):
297296
forentryingetExampleEntries():
298297
defload(entry=entry):
299298
self.loadfile(entry)
300-
menu.add_command(label=entry,underline=0,
301-
font=menufont,command=load)
299+
menu.add_command(label=entry,underline=0,command=load)
302300
returnmenu
303301

304302
defmakeFontMenu(self,master):
305303
menu=Menu(master,tearoff=0)
306-
menu.add_command(label="Decrease (C-'-')",command=self.decrease_size,
307-
font=menufont)
308-
menu.add_command(label="Increase (C-'+')",command=self.increase_size,
309-
font=menufont)
304+
menu.add_command(label="Decrease",command=self.decrease_size,
305+
accelerator=f"{'Command'ifdarwinelse'Ctrl'}+-")
306+
menu.add_command(label="Increase",command=self.increase_size,
307+
accelerator=f"{'Command'ifdarwinelse'Ctrl'}+=")
310308
menu.add_separator()
311309

312310
forsizeinfont_sizes:
313311
defresize(size=size):
314312
self.set_txtsize(size)
315-
menu.add_command(label=str(size),underline=0,
316-
font=menufont,command=resize)
313+
menu.add_command(label=str(size),underline=0,command=resize)
317314
returnmenu
318315

319316
defmakeHelpMenu(self,master):
@@ -322,7 +319,7 @@ def makeHelpMenu(self, master):
322319
forhelp_label,help_fileinhelp_entries:
323320
defshow(help_label=help_label,help_file=help_file):
324321
view_text(self.root,help_label,help_file)
325-
menu.add_command(label=help_label,font=menufont,command=show)
322+
menu.add_command(label=help_label,command=show)
326323
returnmenu
327324

328325
defrefreshCanvas(self):
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Revert the font of:mod:`turtledemo`'s menu bar to its default value and
2+
display the shortcut keys in the correct position.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp