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
72e31642
Kaydet (Commit)
72e31642
authored
May 28, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
made it work again with changed Tkinter
üst
0978f993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
+38
-10
Canvas.py
Lib/lib-tk/Canvas.py
+19
-5
Canvas.py
Lib/tkinter/Canvas.py
+19
-5
No files found.
Lib/lib-tk/Canvas.py
Dosyayı görüntüle @
72e31642
# This module exports classes for the various canvas item types
from
Tkinter
import
Canvas
,
_flatten
from
Tkinter
import
Canvas
StringType
=
type
(
''
)
DictionaryType
=
type
({})
def
_flatten
(
tuple
):
res
=
()
for
item
in
tuple
:
if
type
(
item
)
in
(
TupleType
,
ListType
):
res
=
res
+
_flatten
(
item
)
elif
item
is
not
None
:
res
=
res
+
(
item
,)
return
res
class
CanvasItem
:
def
__init__
(
self
,
canvas
,
itemType
,
*
args
,
**
kw
):
self
.
canvas
=
canvas
...
...
@@ -25,7 +34,7 @@ class CanvasItem:
self
.
id
,
'-'
+
key
))
return
v
[
4
]
def
__setitem__
(
self
,
key
,
value
):
self
.
canvas
.
_
itemconfig
(
self
.
id
,
{
key
:
value
})
self
.
canvas
.
itemconfig
(
self
.
id
,
{
key
:
value
})
def
keys
(
self
):
if
not
hasattr
(
self
,
'_keys'
):
self
.
_keys
=
map
(
lambda
x
,
tk
=
self
.
canvas
.
tk
:
...
...
@@ -34,7 +43,7 @@ class CanvasItem:
self
.
canvas
.
_do
(
'itemconfigure'
,
(
self
.
id
,))))
return
self
.
_keys
return
self
.
_keys
def
has_key
(
self
,
key
):
return
key
in
self
.
keys
()
def
addtag
(
self
,
tag
,
option
=
'withtag'
):
...
...
@@ -68,8 +77,9 @@ class CanvasItem:
self
.
canvas
.
lower
(
self
.
id
,
belowthis
)
def
move
(
self
,
xamount
,
yamount
):
self
.
canvas
.
move
(
self
.
id
,
xamount
,
yamount
)
def
raise_
(
self
,
abovethis
=
None
):
self
.
canvas
.
raise_
(
self
.
id
,
abovethis
)
def
tkraise
(
self
,
abovethis
=
None
):
self
.
canvas
.
tkraise
(
self
.
id
,
abovethis
)
raise_
=
tkraise
# BW compat
def
scale
(
self
,
xorigin
,
yorigin
,
xscale
,
yscale
):
self
.
canvas
.
scale
(
self
.
id
,
xorigin
,
yorigin
,
xscale
,
yscale
)
def
type
(
self
):
...
...
@@ -83,6 +93,10 @@ class Bitmap(CanvasItem):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'bitmap'
,
args
)
class
ImageItem
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'image'
,
args
)
class
Line
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'line'
,
args
)
...
...
Lib/tkinter/Canvas.py
Dosyayı görüntüle @
72e31642
# This module exports classes for the various canvas item types
from
Tkinter
import
Canvas
,
_flatten
from
Tkinter
import
Canvas
StringType
=
type
(
''
)
DictionaryType
=
type
({})
def
_flatten
(
tuple
):
res
=
()
for
item
in
tuple
:
if
type
(
item
)
in
(
TupleType
,
ListType
):
res
=
res
+
_flatten
(
item
)
elif
item
is
not
None
:
res
=
res
+
(
item
,)
return
res
class
CanvasItem
:
def
__init__
(
self
,
canvas
,
itemType
,
*
args
,
**
kw
):
self
.
canvas
=
canvas
...
...
@@ -25,7 +34,7 @@ class CanvasItem:
self
.
id
,
'-'
+
key
))
return
v
[
4
]
def
__setitem__
(
self
,
key
,
value
):
self
.
canvas
.
_
itemconfig
(
self
.
id
,
{
key
:
value
})
self
.
canvas
.
itemconfig
(
self
.
id
,
{
key
:
value
})
def
keys
(
self
):
if
not
hasattr
(
self
,
'_keys'
):
self
.
_keys
=
map
(
lambda
x
,
tk
=
self
.
canvas
.
tk
:
...
...
@@ -34,7 +43,7 @@ class CanvasItem:
self
.
canvas
.
_do
(
'itemconfigure'
,
(
self
.
id
,))))
return
self
.
_keys
return
self
.
_keys
def
has_key
(
self
,
key
):
return
key
in
self
.
keys
()
def
addtag
(
self
,
tag
,
option
=
'withtag'
):
...
...
@@ -68,8 +77,9 @@ class CanvasItem:
self
.
canvas
.
lower
(
self
.
id
,
belowthis
)
def
move
(
self
,
xamount
,
yamount
):
self
.
canvas
.
move
(
self
.
id
,
xamount
,
yamount
)
def
raise_
(
self
,
abovethis
=
None
):
self
.
canvas
.
raise_
(
self
.
id
,
abovethis
)
def
tkraise
(
self
,
abovethis
=
None
):
self
.
canvas
.
tkraise
(
self
.
id
,
abovethis
)
raise_
=
tkraise
# BW compat
def
scale
(
self
,
xorigin
,
yorigin
,
xscale
,
yscale
):
self
.
canvas
.
scale
(
self
.
id
,
xorigin
,
yorigin
,
xscale
,
yscale
)
def
type
(
self
):
...
...
@@ -83,6 +93,10 @@ class Bitmap(CanvasItem):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'bitmap'
,
args
)
class
ImageItem
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'image'
,
args
)
class
Line
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
):
CanvasItem
.
__init__
(
self
,
canvas
,
'line'
,
args
)
...
...
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