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
83bd9a9c
Kaydet (Commit)
83bd9a9c
authored
Eyl 29, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move Widget.config() c.s. to Misc class, so the Tk class also inherits them.
üst
332e1443
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
Tkinter.py
Lib/lib-tk/Tkinter.py
+30
-31
No files found.
Lib/lib-tk/Tkinter.py
Dosyayı görüntüle @
83bd9a9c
...
@@ -567,6 +567,36 @@ class Misc:
...
@@ -567,6 +567,36 @@ class Misc:
exc
,
val
,
tb
=
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
exc
,
val
,
tb
=
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
root
=
self
.
_root
()
root
=
self
.
_root
()
root
.
report_callback_exception
(
exc
,
val
,
tb
)
root
.
report_callback_exception
(
exc
,
val
,
tb
)
# These used to be defined in Widget:
def
config
(
self
,
cnf
=
None
,
**
kw
):
# XXX ought to generalize this so tag_config etc. can use it
if
kw
:
cnf
=
_cnfmerge
((
cnf
,
kw
))
elif
cnf
:
cnf
=
_cnfmerge
(
cnf
)
if
cnf
is
None
:
cnf
=
{}
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
)):
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
if
type
(
cnf
)
is
StringType
:
x
=
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
,
'-'
+
cnf
))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
apply
(
self
.
tk
.
call
,
(
self
.
_w
,
'configure'
)
+
self
.
_options
(
cnf
))
configure
=
config
def
cget
(
self
,
key
):
return
self
.
tk
.
call
(
self
.
_w
,
'cget'
,
'-'
+
key
)
__getitem__
=
cget
def
__setitem__
(
self
,
key
,
value
):
Widget
.
config
(
self
,
{
key
:
value
})
def
keys
(
self
):
return
map
(
lambda
x
:
x
[
0
][
1
:],
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
)))
def
__str__
(
self
):
return
self
.
_w
class
CallWrapper
:
class
CallWrapper
:
def
__init__
(
self
,
func
,
subst
,
widget
):
def
__init__
(
self
,
func
,
subst
,
widget
):
...
@@ -710,8 +740,6 @@ class Tk(Misc, Wm):
...
@@ -710,8 +740,6 @@ class Tk(Misc, Wm):
global
_default_root
global
_default_root
if
_default_root
is
self
:
if
_default_root
is
self
:
_default_root
=
None
_default_root
=
None
def
__str__
(
self
):
return
self
.
_w
def
readprofile
(
self
,
baseName
,
className
):
def
readprofile
(
self
,
baseName
,
className
):
import
os
import
os
if
os
.
environ
.
has_key
(
'HOME'
):
home
=
os
.
environ
[
'HOME'
]
if
os
.
environ
.
has_key
(
'HOME'
):
home
=
os
.
environ
[
'HOME'
]
...
@@ -927,35 +955,6 @@ class Widget(Misc, Pack, Place, Grid):
...
@@ -927,35 +955,6 @@ class Widget(Misc, Pack, Place, Grid):
(
widgetName
,
self
.
_w
)
+
extra
+
self
.
_options
(
cnf
))
(
widgetName
,
self
.
_w
)
+
extra
+
self
.
_options
(
cnf
))
for
k
,
v
in
classes
:
for
k
,
v
in
classes
:
k
.
config
(
self
,
v
)
k
.
config
(
self
,
v
)
def
config
(
self
,
cnf
=
None
,
**
kw
):
# XXX ought to generalize this so tag_config etc. can use it
if
kw
:
cnf
=
_cnfmerge
((
cnf
,
kw
))
elif
cnf
:
cnf
=
_cnfmerge
(
cnf
)
if
cnf
is
None
:
cnf
=
{}
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
)):
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
if
type
(
cnf
)
is
StringType
:
x
=
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
,
'-'
+
cnf
))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
apply
(
self
.
tk
.
call
,
(
self
.
_w
,
'configure'
)
+
self
.
_options
(
cnf
))
configure
=
config
def
cget
(
self
,
key
):
return
self
.
tk
.
call
(
self
.
_w
,
'cget'
,
'-'
+
key
)
__getitem__
=
cget
def
__setitem__
(
self
,
key
,
value
):
Widget
.
config
(
self
,
{
key
:
value
})
def
keys
(
self
):
return
map
(
lambda
x
:
x
[
0
][
1
:],
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
)))
def
__str__
(
self
):
return
self
.
_w
def
destroy
(
self
):
def
destroy
(
self
):
for
c
in
self
.
children
.
values
():
c
.
destroy
()
for
c
in
self
.
children
.
values
():
c
.
destroy
()
if
self
.
master
.
children
.
has_key
(
self
.
_name
):
if
self
.
master
.
children
.
has_key
(
self
.
_name
):
...
...
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