MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / draw_oval

Method draw_oval

PySimpleGUI/PySimpleGUI.py:6394–6422  ·  view source on GitHub ↗

Draws an oval based on coordinates in user coordinate system. Provide the location of a "bounding rectangle" :param top_left: the top left point of bounding rectangle :type top_left: (int, int) | Tuple[float, float] :param bottom_right: the bottom right poin

(self, top_left, bottom_right, fill_color=None, line_color=None, line_width=1)

Source from the content-addressed store, hash-verified

6392 return id
6393
6394 def draw_oval(self, top_left, bottom_right, fill_color=None, line_color=None, line_width=1):
6395 """
6396 Draws an oval based on coordinates in user coordinate system. Provide the location of a "bounding rectangle"
6397 :param top_left: the top left point of bounding rectangle
6398 :type top_left: (int, int) | Tuple[float, float]
6399 :param bottom_right: the bottom right point of bounding rectangle
6400 :type bottom_right: (int, int) | Tuple[float, float]
6401 :param fill_color: color of the interrior
6402 :type fill_color: (str)
6403 :param line_color: color of outline of oval
6404 :type line_color: (str)
6405 :param line_width: width of the line around the oval, the outline, in pixels
6406 :type line_width: (int)
6407 :return: id returned from tkinter that you'll need if you want to manipulate the oval
6408 :rtype: int | None
6409 """
6410 converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1])
6411 converted_bottom_right = self._convert_xy_to_canvas_xy(bottom_right[0], bottom_right[1])
6412 if self._TKCanvas2 is None:
6413 print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***')
6414 print('Call Window.Finalize() prior to this operation')
6415 return None
6416 try: # in case windows close with X
6417 id = self._TKCanvas2.create_oval(converted_top_left[0], converted_top_left[1], converted_bottom_right[0],
6418 converted_bottom_right[1], fill=fill_color, outline=line_color, width=line_width)
6419 except:
6420 id = None
6421
6422 return id
6423
6424 def draw_arc(self, top_left, bottom_right, extent, start_angle, style=None, arc_color='black', line_width=1, fill_color=None):
6425 """

Callers 1

Calls 1

Tested by

no test coverage detected