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
50f437c9
Kaydet (Commit)
50f437c9
authored
Tem 12, 1994
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added names to demo widgets; added RemoteWidgetDialog.
üst
3e4f182f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
9 deletions
+79
-9
AttrDialog.py
Demo/tkinter/guido/AttrDialog.py
+79
-9
No files found.
Demo/tkinter/guido/AttrDialog.py
Dosyayı görüntüle @
50f437c9
...
...
@@ -148,6 +148,7 @@ class PackDialog(Dialog):
def
refresh
(
self
):
self
.
current
=
self
.
widget
.
newinfo
()
self
.
current
[
'.class'
]
=
self
.
widget
.
winfo_class
()
self
.
current
[
'.name'
]
=
self
.
widget
.
_w
class
packoption
:
# Mix-in class
def
set
(
self
,
e
=
None
):
...
...
@@ -165,7 +166,8 @@ class PackDialog(Dialog):
options
=
{
'.class'
:
(
None
,
'Class'
),
'after'
:
(
None
,
'Widet'
),
'.name'
:
(
None
,
'Name'
),
'after'
:
(
None
,
'Widget'
),
'anchor'
:
(
'center'
,
'Anchor'
),
'before'
:
(
None
,
'Widget'
),
'expand'
:
(
'no'
,
'Boolean'
),
...
...
@@ -184,6 +186,7 @@ class PackDialog(Dialog):
'Class'
:
'readonly'
,
'Expand'
:
'boolean'
,
'Fill'
:
(
'none'
,
'x'
,
'y'
,
'both'
),
'Name'
:
'readonly'
,
'Pad'
:
'pixel'
,
'Side'
:
(
'top'
,
'right'
,
'bottom'
,
'left'
),
'Widget'
:
'readonly'
,
...
...
@@ -197,8 +200,8 @@ class RemotePackDialog(PackDialog):
self
.
widget
=
widget
self
.
refresh
()
self
.
top
=
Toplevel
(
self
.
master
)
self
.
top
.
title
(
'Remote
%
s Pack:
%
s'
%
(
self
.
app
,
self
.
widget
)
)
self
.
top
.
minsize
(
1
,
1
)
# XXX
self
.
top
.
title
(
self
.
app
+
' PackDialog'
)
self
.
top
.
minsize
(
1
,
1
)
self
.
addchoices
()
def
refresh
(
self
):
...
...
@@ -220,6 +223,7 @@ class RemotePackDialog(PackDialog):
'winfo'
,
'class'
,
self
.
widget
)
dict
[
'.name'
]
=
self
.
widget
self
.
current
=
dict
class
remotepackoption
:
# Mix-in class
...
...
@@ -254,14 +258,19 @@ class WidgetDialog(Dialog):
def
refresh
(
self
):
self
.
configuration
=
self
.
widget
.
config
()
self
.
update
()
self
.
current
[
'.class'
]
=
self
.
widget
.
winfo_class
()
self
.
current
[
'.name'
]
=
self
.
widget
.
_w
def
update
(
self
):
self
.
current
=
{}
self
.
options
=
{}
self
.
options
[
'.class'
]
=
(
None
,
'Class'
)
self
.
current
[
'.class'
]
=
self
.
widget
.
winfo_class
()
for
k
,
v
in
self
.
configuration
.
items
():
if
len
(
v
)
>
4
:
self
.
current
[
k
]
=
v
[
4
]
self
.
options
[
k
]
=
v
[
3
],
v
[
2
]
# default, klass
self
.
options
[
'.class'
]
=
(
None
,
'Class'
)
self
.
options
[
'.name'
]
=
(
None
,
'Name'
)
class
widgetoption
:
# Mix-in class
def
set
(
self
,
e
=
None
):
...
...
@@ -301,6 +310,7 @@ class WidgetDialog(Dialog):
'Label'
:
'string'
,
'Length'
:
'pixel'
,
'MenuName'
:
'widget'
,
'Name'
:
'readonly'
,
'OffTime'
:
'time'
,
'OnTime'
:
'time'
,
'Orient'
:
(
'horizontal'
,
'vertical'
),
...
...
@@ -337,7 +347,60 @@ class WidgetDialog(Dialog):
'menubutton'
:
_tristate
,
'slider'
:
_bistate
,
}
class
RemoteWidgetDialog
(
WidgetDialog
):
def
__init__
(
self
,
master
,
app
,
widget
):
self
.
master
=
master
self
.
app
=
app
self
.
widget
=
widget
self
.
refresh
()
self
.
top
=
Toplevel
(
self
.
master
)
self
.
top
.
title
(
self
.
app
+
' WidgetDialog'
)
self
.
top
.
minsize
(
1
,
1
)
self
.
addchoices
()
def
refresh
(
self
):
try
:
items
=
self
.
master
.
tk
.
splitlist
(
self
.
master
.
send
(
self
.
app
,
self
.
widget
,
'config'
))
except
TclError
,
msg
:
print
'send widget config'
,
self
.
widget
,
':'
,
msg
return
dict
=
{}
for
item
in
items
:
words
=
self
.
master
.
tk
.
splitlist
(
item
)
key
=
words
[
0
][
1
:]
value
=
(
key
,)
+
words
[
1
:]
dict
[
key
]
=
value
self
.
configuration
=
dict
self
.
update
()
self
.
current
[
'.class'
]
=
self
.
master
.
send
(
self
.
app
,
'winfo'
,
'class'
,
self
.
widget
)
self
.
current
[
'.name'
]
=
self
.
widget
class
remotewidgetoption
:
# Mix-in class
def
set
(
self
,
e
=
None
):
self
.
current
=
self
.
var
.
get
()
try
:
self
.
dialog
.
master
.
send
(
self
.
dialog
.
app
,
self
.
dialog
.
widget
,
'config'
,
'-'
+
self
.
option
,
self
.
current
)
except
TclError
,
msg
:
print
'send widget config :'
,
msg
self
.
refresh
()
class
booleanoption
(
remotewidgetoption
,
BooleanOption
):
pass
class
enumoption
(
remotewidgetoption
,
EnumOption
):
pass
class
stringoption
(
remotewidgetoption
,
StringOption
):
pass
class
readonlyoption
(
remotewidgetoption
,
ReadonlyOption
):
pass
def
test
():
import
sys
...
...
@@ -345,11 +408,18 @@ def test():
root
.
minsize
(
1
,
1
)
if
sys
.
argv
[
2
:]:
pd
=
RemotePackDialog
(
root
,
sys
.
argv
[
1
],
sys
.
argv
[
2
])
wd
=
RemoteWidgetDialog
(
root
,
sys
.
argv
[
1
],
sys
.
argv
[
2
])
else
:
frame
=
Frame
(
root
,
{
Pack
:
{
'expand'
:
1
,
'fill'
:
'both'
}})
button
=
Button
(
frame
,
{
'text'
:
'button'
,
frame
=
Frame
(
root
,
{
'name'
:
'frame'
,
Pack
:
{
'expand'
:
1
,
'fill'
:
'both'
},
})
button
=
Button
(
frame
,
{
'name'
:
'button'
,
'text'
:
'button'
,
Pack
:
{
'expand'
:
1
}})
canvas
=
Canvas
(
frame
,
{
Pack
:
{}})
canvas
=
Canvas
(
frame
,
{
'name'
:
'canvas'
,
Pack
:
{}})
fpd
=
PackDialog
(
frame
)
fwd
=
WidgetDialog
(
frame
)
bpd
=
PackDialog
(
button
)
bwd
=
WidgetDialog
(
button
)
cpd
=
PackDialog
(
canvas
)
...
...
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