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
3d0df46f
Kaydet (Commit)
3d0df46f
authored
Agu 03, 1994
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
AttrDialog.py: some structural changes
listtree.py: "Print" -> "List" in description
üst
d7b19488
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
29 deletions
+45
-29
AttrDialog.py
Demo/tkinter/guido/AttrDialog.py
+44
-28
listtree.py
Demo/tkinter/guido/listtree.py
+1
-1
No files found.
Demo/tkinter/guido/AttrDialog.py
Dosyayı görüntüle @
3d0df46f
...
@@ -100,18 +100,24 @@ class ReadonlyOption(Option):
...
@@ -100,18 +100,24 @@ class ReadonlyOption(Option):
def
addoption
(
self
):
def
addoption
(
self
):
self
.
label
=
Label
(
self
.
frame
,
self
.
label
=
Label
(
self
.
frame
,
{
'textvariable'
:
self
.
var
,
{
'textvariable'
:
self
.
var
,
'anchor'
:
'e'
,
Pack
:
{
'side'
:
'right'
}})
Pack
:
{
'side'
:
'right'
}})
class
Dialog
:
class
Dialog
:
def
__init__
(
self
,
master
):
def
__init__
(
self
,
master
):
self
.
master
=
master
self
.
master
=
master
self
.
fixclasses
()
self
.
refresh
()
self
.
refresh
()
self
.
top
=
Toplevel
(
self
.
master
)
self
.
top
=
Toplevel
(
self
.
master
)
self
.
top
.
title
(
self
.
__class__
.
__name__
)
self
.
top
.
title
(
self
.
__class__
.
__name__
)
self
.
top
.
minsize
(
1
,
1
)
self
.
top
.
minsize
(
1
,
1
)
self
.
addchoices
()
self
.
addchoices
()
def
refresh
(
self
):
pass
# Must override
def
fixclasses
(
self
):
pass
# May override
def
addchoices
(
self
):
def
addchoices
(
self
):
self
.
choices
=
{}
self
.
choices
=
{}
list
=
[]
list
=
[]
...
@@ -133,6 +139,11 @@ class Dialog:
...
@@ -133,6 +139,11 @@ class Dialog:
cl
=
self
.
stringoption
cl
=
self
.
stringoption
self
.
choices
[
k
]
=
cl
(
self
,
k
)
self
.
choices
[
k
]
=
cl
(
self
,
k
)
# Must override:
options
=
{}
classes
=
{}
# May override:
booleanoption
=
BooleanOption
booleanoption
=
BooleanOption
stringoption
=
StringOption
stringoption
=
StringOption
enumoption
=
EnumOption
enumoption
=
EnumOption
...
@@ -155,7 +166,8 @@ class PackDialog(Dialog):
...
@@ -155,7 +166,8 @@ class PackDialog(Dialog):
try
:
try
:
Pack
.
config
(
self
.
dialog
.
widget
,
Pack
.
config
(
self
.
dialog
.
widget
,
{
self
.
option
:
self
.
current
})
{
self
.
option
:
self
.
current
})
except
TclError
:
except
TclError
,
msg
:
print
msg
self
.
refresh
()
self
.
refresh
()
class
booleanoption
(
packoption
,
BooleanOption
):
pass
class
booleanoption
(
packoption
,
BooleanOption
):
pass
...
@@ -211,7 +223,7 @@ class RemotePackDialog(PackDialog):
...
@@ -211,7 +223,7 @@ class RemotePackDialog(PackDialog):
'newinfo'
,
'newinfo'
,
self
.
widget
))
self
.
widget
))
except
TclError
,
msg
:
except
TclError
,
msg
:
print
'send pack newinfo'
,
self
.
widget
,
':'
,
msg
print
msg
return
return
dict
=
{}
dict
=
{}
for
i
in
range
(
0
,
len
(
words
),
2
):
for
i
in
range
(
0
,
len
(
words
),
2
):
...
@@ -231,10 +243,14 @@ class RemotePackDialog(PackDialog):
...
@@ -231,10 +243,14 @@ class RemotePackDialog(PackDialog):
try
:
try
:
self
.
dialog
.
master
.
send
(
self
.
dialog
.
master
.
send
(
self
.
dialog
.
app
,
self
.
dialog
.
app
,
'pack'
,
'config'
,
self
.
dialog
.
widget
,
'pack'
,
'-'
+
self
.
option
,
self
.
current
)
'config'
,
self
.
dialog
.
widget
,
'-'
+
self
.
option
,
self
.
dialog
.
master
.
tk
.
merge
(
self
.
current
))
except
TclError
,
msg
:
except
TclError
,
msg
:
print
'send pack config ... :'
,
msg
print
msg
self
.
refresh
()
self
.
refresh
()
class
booleanoption
(
remotepackoption
,
BooleanOption
):
pass
class
booleanoption
(
remotepackoption
,
BooleanOption
):
pass
...
@@ -246,14 +262,17 @@ class WidgetDialog(Dialog):
...
@@ -246,14 +262,17 @@ class WidgetDialog(Dialog):
def
__init__
(
self
,
widget
):
def
__init__
(
self
,
widget
):
self
.
widget
=
widget
self
.
widget
=
widget
if
self
.
addclasses
.
has_key
(
self
.
widget
.
widgetName
):
self
.
klass
=
widget
.
winfo_class
()
Dialog
.
__init__
(
self
,
widget
)
def
fixclasses
(
self
):
if
self
.
addclasses
.
has_key
(
self
.
klass
):
classes
=
{}
classes
=
{}
for
c
in
(
self
.
classes
,
for
c
in
(
self
.
classes
,
self
.
addclasses
[
self
.
widget
.
widgetName
]):
self
.
addclasses
[
self
.
klass
]):
for
k
in
c
.
keys
():
for
k
in
c
.
keys
():
classes
[
k
]
=
c
[
k
]
classes
[
k
]
=
c
[
k
]
self
.
classes
=
classes
self
.
classes
=
classes
Dialog
.
__init__
(
self
,
widget
)
def
refresh
(
self
):
def
refresh
(
self
):
self
.
configuration
=
self
.
widget
.
config
()
self
.
configuration
=
self
.
widget
.
config
()
...
@@ -276,7 +295,8 @@ class WidgetDialog(Dialog):
...
@@ -276,7 +295,8 @@ class WidgetDialog(Dialog):
self
.
current
=
self
.
var
.
get
()
self
.
current
=
self
.
var
.
get
()
try
:
try
:
self
.
dialog
.
widget
[
self
.
option
]
=
self
.
current
self
.
dialog
.
widget
[
self
.
option
]
=
self
.
current
except
TclError
:
except
TclError
,
msg
:
print
msg
self
.
refresh
()
self
.
refresh
()
class
booleanoption
(
widgetoption
,
BooleanOption
):
pass
class
booleanoption
(
widgetoption
,
BooleanOption
):
pass
...
@@ -338,26 +358,25 @@ class WidgetDialog(Dialog):
...
@@ -338,26 +358,25 @@ class WidgetDialog(Dialog):
_tristate
=
{
'State'
:
(
'normal'
,
'active'
,
'disabled'
)}
_tristate
=
{
'State'
:
(
'normal'
,
'active'
,
'disabled'
)}
_bistate
=
{
'State'
:
(
'normal'
,
'disabled'
)}
_bistate
=
{
'State'
:
(
'normal'
,
'disabled'
)}
addclasses
=
{
addclasses
=
{
'
b
utton'
:
_tristate
,
'
B
utton'
:
_tristate
,
'
r
adiobutton'
:
_tristate
,
'
R
adiobutton'
:
_tristate
,
'
c
heckbutton'
:
_tristate
,
'
C
heckbutton'
:
_tristate
,
'
e
ntry'
:
_bistate
,
'
E
ntry'
:
_bistate
,
'
t
ext'
:
_bistate
,
'
T
ext'
:
_bistate
,
'
m
enubutton'
:
_tristate
,
'
M
enubutton'
:
_tristate
,
'
s
lider'
:
_bistate
,
'
S
lider'
:
_bistate
,
}
}
class
RemoteWidgetDialog
(
WidgetDialog
):
class
RemoteWidgetDialog
(
WidgetDialog
):
def
__init__
(
self
,
master
,
app
,
widget
):
def
__init__
(
self
,
master
,
app
,
widget
):
self
.
master
=
master
self
.
app
=
app
self
.
app
=
app
self
.
widget
=
widget
self
.
widget
=
widget
self
.
refresh
()
self
.
klass
=
master
.
send
(
self
.
app
,
self
.
top
=
Toplevel
(
self
.
master
)
'winfo'
,
self
.
top
.
title
(
self
.
app
+
' WidgetDialog'
)
'class'
,
self
.
top
.
minsize
(
1
,
1
)
self
.
widget
)
self
.
addchoices
(
)
Dialog
.
__init__
(
self
,
master
)
def
refresh
(
self
):
def
refresh
(
self
):
try
:
try
:
...
@@ -366,7 +385,7 @@ class RemoteWidgetDialog(WidgetDialog):
...
@@ -366,7 +385,7 @@ class RemoteWidgetDialog(WidgetDialog):
self
.
widget
,
self
.
widget
,
'config'
))
'config'
))
except
TclError
,
msg
:
except
TclError
,
msg
:
print
'send widget config'
,
self
.
widget
,
':'
,
msg
print
msg
return
return
dict
=
{}
dict
=
{}
for
item
in
items
:
for
item
in
items
:
...
@@ -376,10 +395,7 @@ class RemoteWidgetDialog(WidgetDialog):
...
@@ -376,10 +395,7 @@ class RemoteWidgetDialog(WidgetDialog):
dict
[
key
]
=
value
dict
[
key
]
=
value
self
.
configuration
=
dict
self
.
configuration
=
dict
self
.
update
()
self
.
update
()
self
.
current
[
'.class'
]
=
self
.
master
.
send
(
self
.
app
,
self
.
current
[
'.class'
]
=
self
.
klass
'winfo'
,
'class'
,
self
.
widget
)
self
.
current
[
'.name'
]
=
self
.
widget
self
.
current
[
'.name'
]
=
self
.
widget
class
remotewidgetoption
:
# Mix-in class
class
remotewidgetoption
:
# Mix-in class
...
@@ -393,7 +409,7 @@ class RemoteWidgetDialog(WidgetDialog):
...
@@ -393,7 +409,7 @@ class RemoteWidgetDialog(WidgetDialog):
'-'
+
self
.
option
,
'-'
+
self
.
option
,
self
.
current
)
self
.
current
)
except
TclError
,
msg
:
except
TclError
,
msg
:
print
'send widget config :'
,
msg
print
msg
self
.
refresh
()
self
.
refresh
()
class
booleanoption
(
remotewidgetoption
,
BooleanOption
):
pass
class
booleanoption
(
remotewidgetoption
,
BooleanOption
):
pass
...
...
Demo/tkinter/guido/listtree.py
Dosyayı görüntüle @
3d0df46f
#
Prin
t a remote app's widget tree (names and classes only)
#
Lis
t a remote app's widget tree (names and classes only)
import
sys
import
sys
import
string
import
string
...
...
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