Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f819ef74
Kaydet (Commit)
f819ef74
authored
Agu 15, 2014
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22065: Update turtledemo menu creation; don't use obsolete Menubutton.
üst
011b55b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
27 deletions
+22
-27
__main__.py
Lib/turtledemo/__main__.py
+22
-27
No files found.
Lib/turtledemo/__main__.py
Dosyayı görüntüle @
f819ef74
...
@@ -139,22 +139,24 @@ class DemoWindow(object):
...
@@ -139,22 +139,24 @@ class DemoWindow(object):
stdout
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
)
)
root
.
grid_rowconfigure
(
1
,
weight
=
1
)
root
.
grid_rowconfigure
(
0
,
weight
=
1
)
root
.
grid_columnconfigure
(
0
,
weight
=
1
)
root
.
grid_columnconfigure
(
0
,
weight
=
1
)
root
.
grid_columnconfigure
(
1
,
minsize
=
90
,
weight
=
1
)
root
.
grid_columnconfigure
(
1
,
minsize
=
90
,
weight
=
1
)
root
.
grid_columnconfigure
(
2
,
minsize
=
90
,
weight
=
1
)
root
.
grid_columnconfigure
(
2
,
minsize
=
90
,
weight
=
1
)
root
.
grid_columnconfigure
(
3
,
minsize
=
90
,
weight
=
1
)
root
.
grid_columnconfigure
(
3
,
minsize
=
90
,
weight
=
1
)
self
.
mBar
=
Frame
(
root
,
relief
=
RAISED
,
borderwidth
=
2
)
self
.
mBar
=
Menu
(
root
,
relief
=
RAISED
,
borderwidth
=
2
)
self
.
ExamplesBtn
=
self
.
makeLoadDemoMenu
()
self
.
mBar
.
add_cascade
(
menu
=
self
.
makeLoadDemoMenu
(
self
.
mBar
),
self
.
OptionsBtn
=
self
.
makeHelpMenu
()
label
=
'Examples'
,
underline
=
0
,
font
=
menufont
)
self
.
mBar
.
grid
(
row
=
0
,
columnspan
=
4
,
sticky
=
'news'
)
self
.
mBar
.
add_cascade
(
menu
=
self
.
makeHelpMenu
(
self
.
mBar
),
label
=
'Help'
,
underline
=
0
,
font
=
menufont
)
root
[
'menu'
]
=
self
.
mBar
pane
=
PanedWindow
(
orient
=
HORIZONTAL
,
sashwidth
=
5
,
pane
=
PanedWindow
(
orient
=
HORIZONTAL
,
sashwidth
=
5
,
sashrelief
=
SOLID
,
bg
=
'#ddd'
)
sashrelief
=
SOLID
,
bg
=
'#ddd'
)
pane
.
add
(
self
.
makeTextFrame
(
pane
))
pane
.
add
(
self
.
makeTextFrame
(
pane
))
pane
.
add
(
self
.
makeGraphFrame
(
pane
))
pane
.
add
(
self
.
makeGraphFrame
(
pane
))
pane
.
grid
(
row
=
1
,
columnspan
=
4
,
sticky
=
'news'
)
pane
.
grid
(
row
=
0
,
columnspan
=
4
,
sticky
=
'news'
)
self
.
output_lbl
=
Label
(
root
,
height
=
1
,
text
=
" --- "
,
bg
=
"#ddf"
,
self
.
output_lbl
=
Label
(
root
,
height
=
1
,
text
=
" --- "
,
bg
=
"#ddf"
,
font
=
(
"Arial"
,
16
,
'normal'
),
borderwidth
=
2
,
font
=
(
"Arial"
,
16
,
'normal'
),
borderwidth
=
2
,
...
@@ -168,10 +170,10 @@ class DemoWindow(object):
...
@@ -168,10 +170,10 @@ class DemoWindow(object):
self
.
clear_btn
=
Button
(
root
,
text
=
" CLEAR "
,
font
=
btnfont
,
self
.
clear_btn
=
Button
(
root
,
text
=
" CLEAR "
,
font
=
btnfont
,
fg
=
"white"
,
disabledforeground
=
"#fed"
,
fg
=
"white"
,
disabledforeground
=
"#fed"
,
command
=
self
.
clearCanvas
)
command
=
self
.
clearCanvas
)
self
.
output_lbl
.
grid
(
row
=
2
,
column
=
0
,
sticky
=
'news'
,
padx
=
(
0
,
5
))
self
.
output_lbl
.
grid
(
row
=
1
,
column
=
0
,
sticky
=
'news'
,
padx
=
(
0
,
5
))
self
.
start_btn
.
grid
(
row
=
2
,
column
=
1
,
sticky
=
'ew'
)
self
.
start_btn
.
grid
(
row
=
1
,
column
=
1
,
sticky
=
'ew'
)
self
.
stop_btn
.
grid
(
row
=
2
,
column
=
2
,
sticky
=
'ew'
)
self
.
stop_btn
.
grid
(
row
=
1
,
column
=
2
,
sticky
=
'ew'
)
self
.
clear_btn
.
grid
(
row
=
2
,
column
=
3
,
sticky
=
'ew'
)
self
.
clear_btn
.
grid
(
row
=
1
,
column
=
3
,
sticky
=
'ew'
)
Percolator
(
self
.
text
)
.
insertfilter
(
ColorDelegator
())
Percolator
(
self
.
text
)
.
insertfilter
(
ColorDelegator
())
self
.
dirty
=
False
self
.
dirty
=
False
...
@@ -224,7 +226,7 @@ class DemoWindow(object):
...
@@ -224,7 +226,7 @@ class DemoWindow(object):
return
canvas
return
canvas
def
configGUI
(
self
,
menu
,
start
,
stop
,
clear
,
txt
=
""
,
color
=
"blue"
):
def
configGUI
(
self
,
menu
,
start
,
stop
,
clear
,
txt
=
""
,
color
=
"blue"
):
self
.
ExamplesBtn
.
config
(
state
=
menu
)
self
.
mBar
.
entryconfigure
(
0
,
state
=
menu
)
self
.
start_btn
.
config
(
state
=
start
,
self
.
start_btn
.
config
(
state
=
start
,
bg
=
"#d00"
if
start
==
NORMAL
else
"#fca"
)
bg
=
"#d00"
if
start
==
NORMAL
else
"#fca"
)
...
@@ -234,35 +236,28 @@ class DemoWindow(object):
...
@@ -234,35 +236,28 @@ class DemoWindow(object):
bg
=
"#d00"
if
clear
==
NORMAL
else
"#fca"
)
bg
=
"#d00"
if
clear
==
NORMAL
else
"#fca"
)
self
.
output_lbl
.
config
(
text
=
txt
,
fg
=
color
)
self
.
output_lbl
.
config
(
text
=
txt
,
fg
=
color
)
def
makeLoadDemoMenu
(
self
):
def
makeLoadDemoMenu
(
self
,
master
):
CmdBtn
=
Menubutton
(
self
.
mBar
,
text
=
'Examples'
,
menu
=
Menu
(
master
)
underline
=
0
,
font
=
menufont
)
CmdBtn
.
pack
(
side
=
LEFT
,
padx
=
"2m"
)
CmdBtn
.
menu
=
Menu
(
CmdBtn
)
for
entry
in
getExampleEntries
():
for
entry
in
getExampleEntries
():
def
loadexample
(
x
):
def
loadexample
(
x
):
def
emit
():
def
emit
():
self
.
loadfile
(
x
)
self
.
loadfile
(
x
)
return
emit
return
emit
CmdBtn
.
menu
.
add_command
(
label
=
entry
,
underline
=
0
,
menu
.
add_command
(
label
=
entry
,
underline
=
0
,
font
=
menufont
,
command
=
loadexample
(
entry
))
font
=
menufont
,
command
=
loadexample
(
entry
))
CmdBtn
[
'menu'
]
=
CmdBtn
.
menu
return
menu
return
CmdBtn
def
makeHelpMenu
(
self
):
def
makeHelpMenu
(
self
,
master
):
CmdBtn
=
Menubutton
(
self
.
mBar
,
text
=
'Help'
,
underline
=
0
,
font
=
menufont
)
menu
=
Menu
(
master
)
CmdBtn
.
pack
(
side
=
LEFT
,
padx
=
'2m'
)
CmdBtn
.
menu
=
Menu
(
CmdBtn
)
for
help_label
,
help_file
in
help_entries
:
for
help_label
,
help_file
in
help_entries
:
def
show
(
help_label
=
help_label
,
help_file
=
help_file
):
def
show
(
help_label
=
help_label
,
help_file
=
help_file
):
view_text
(
self
.
root
,
help_label
,
help_file
)
view_text
(
self
.
root
,
help_label
,
help_file
)
CmdBtn
.
menu
.
add_command
(
label
=
help_label
,
font
=
menufont
,
command
=
show
)
menu
.
add_command
(
label
=
help_label
,
font
=
menufont
,
command
=
show
)
CmdBtn
[
'menu'
]
=
CmdBtn
.
menu
return
menu
return
CmdBtn
def
refreshCanvas
(
self
):
def
refreshCanvas
(
self
):
if
not
self
.
dirty
:
return
if
not
self
.
dirty
:
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment