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
bf034715
Kaydet (Commit)
bf034715
authored
Eki 12, 2018
tarafından
Juliette Monsel
Kaydeden (comit)
Serhiy Storchaka
Eki 12, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768)
üst
dc0d571b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
3.8.rst
Doc/whatsnew/3.8.rst
+4
-0
__init__.py
Lib/tkinter/__init__.py
+9
-0
test_widgets.py
Lib/tkinter/test/test_tkinter/test_widgets.py
+23
-0
2018-10-09-15-44-04.bpo-23831.2CL7lL.rst
...S.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst
+2
-0
No files found.
Doc/whatsnew/3.8.rst
Dosyayı görüntüle @
bf034715
...
...
@@ -177,6 +177,10 @@ Added methods :meth:`~tkinter.Spinbox.selection_from`,
in the :class:`tkinter.Spinbox` class.
(Contributed by Juliette Monsel in :issue:`34829`.)
Added method :meth:`~tkinter.Canvas.moveto`
in the :class:`tkinter.Canvas` class.
(Contributed by Juliette Monsel in :issue:`23831`.)
venv
----
...
...
Lib/tkinter/__init__.py
Dosyayı görüntüle @
bf034715
...
...
@@ -2914,6 +2914,15 @@ class Canvas(Widget, XView, YView):
"""Move an item TAGORID given in ARGS."""
self
.
tk
.
call
((
self
.
_w
,
'move'
)
+
args
)
def
moveto
(
self
,
tagOrId
,
x
=
''
,
y
=
''
):
"""Move the items given by TAGORID in the canvas coordinate
space so that the first coordinate pair of the bottommost
item with tag TAGORID is located at position (X,Y).
X and Y may be the empty string, in which case the
corresponding coordinate will be unchanged. All items matching
TAGORID remain in the same positions relative to each other."""
self
.
tk
.
call
(
self
.
_w
,
'moveto'
,
tagOrId
,
x
,
y
)
def
postscript
(
self
,
cnf
=
{},
**
kw
):
"""Print the contents of the canvas to a postscript
file. Valid options: colormap, colormode, file, fontmap,
...
...
Lib/tkinter/test/test_tkinter/test_widgets.py
Dosyayı görüntüle @
bf034715
...
...
@@ -745,6 +745,29 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
self
.
checkPixelsParam
(
widget
,
'yscrollincrement'
,
10
,
0
,
11.2
,
13.6
,
-
10
,
'0.1i'
)
@requires_tcl
(
8
,
6
)
def
test_moveto
(
self
):
widget
=
self
.
create
()
i1
=
widget
.
create_rectangle
(
1
,
1
,
20
,
20
,
tags
=
'group'
)
i2
=
widget
.
create_rectangle
(
30
,
30
,
50
,
70
,
tags
=
'group'
)
x1
,
y1
,
_
,
_
=
widget
.
bbox
(
i1
)
x2
,
y2
,
_
,
_
=
widget
.
bbox
(
i2
)
widget
.
moveto
(
'group'
,
200
,
100
)
x1_2
,
y1_2
,
_
,
_
=
widget
.
bbox
(
i1
)
x2_2
,
y2_2
,
_
,
_
=
widget
.
bbox
(
i2
)
self
.
assertEqual
(
x1_2
,
200
)
self
.
assertEqual
(
y1_2
,
100
)
self
.
assertEqual
(
x2
-
x1
,
x2_2
-
x1_2
)
self
.
assertEqual
(
y2
-
y1
,
y2_2
-
y1_2
)
widget
.
tag_lower
(
i2
,
i1
)
widget
.
moveto
(
'group'
,
y
=
50
)
x1_3
,
y1_3
,
_
,
_
=
widget
.
bbox
(
i1
)
x2_3
,
y2_3
,
_
,
_
=
widget
.
bbox
(
i2
)
self
.
assertEqual
(
y2_3
,
50
)
self
.
assertEqual
(
x2_3
,
x2_2
)
self
.
assertEqual
(
x2_2
-
x1_2
,
x2_3
-
x1_3
)
self
.
assertEqual
(
y2_2
-
y1_2
,
y2_3
-
y1_3
)
@add_standard_options
(
IntegerSizeTests
,
StandardOptionsTests
)
class
ListboxTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
...
...
Misc/NEWS.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst
0 → 100644
Dosyayı görüntüle @
bf034715
Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch by Juliette
Monsel.
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