Merge pull request #1803 from PySimpleGUI/Dev-latest

New Graph methods - SendFigureToBack, BringFigureToFront
This commit is contained in:
MikeTheWatchGuy 2019-08-11 12:30:40 -04:00 committed by GitHub
commit 393cb930bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3
version = __version__ = "4.2.0.4 Unreleased"
version = __version__ = "4.2.0.5 Unreleased"
# 888888ba .d88888b oo dP .88888. dP dP dP
@ -3105,6 +3105,26 @@ class Graph(Element):
xy = self._TKCanvas2.coords(figure)
self._TKCanvas2.move(figure, shift_converted[0] - xy[0], shift_converted[1] - xy[1])
def SendFigureToBack(self, figure):
"""
Changes Z-order of figures on the Graph. Sends the indicated figure to the back of all other drawn figures
:param figure: (int) value returned by tkinter when creating the figure / drawing
"""
self.TKCanvas.tag_lower(figure) # move figure to the "bottom" of all other figure
def BringFigureToFront(self, figure):
"""
Changes Z-order of figures on the Graph. Brings the indicated figure to the front of all other drawn figures
:param figure: (int) value returned by tkinter when creating the figure / drawing
"""
self.TKCanvas.tag_raise(figure) # move figure to the "top" of all other figures
@property
def TKCanvas(self):
""" """