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

Method draw_arc

PySimpleGUI/PySimpleGUI.py:6424–6458  ·  view source on GitHub ↗

Draws different types of arcs. Uses a "bounding box" to define location :param top_left: the top left point of bounding rectangle :type top_left: (int, int) | Tuple[float, float] :param bottom_right: the bottom right point of bounding rectangle :typ

(self, top_left, bottom_right, extent, start_angle, style=None, arc_color='black', line_width=1, fill_color=None)

Source from the content-addressed store, hash-verified

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 """
6426 Draws different types of arcs. Uses a "bounding box" to define location
6427 :param top_left: the top left point of bounding rectangle
6428 :type top_left: (int, int) | Tuple[float, float]
6429 :param bottom_right: the bottom right point of bounding rectangle
6430 :type bottom_right: (int, int) | Tuple[float, float]
6431 :param extent: Andle to end drawing. Used in conjunction with start_angle
6432 :type extent: (float)
6433 :param start_angle: Angle to begin drawing. Used in conjunction with extent
6434 :type start_angle: (float)
6435 :param style: Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter'
6436 :type style: (str)
6437 :param arc_color: color to draw arc with
6438 :type arc_color: (str)
6439 :param fill_color: color to fill the area
6440 :type fill_color: (str)
6441 :return: id returned from tkinter that you'll need if you want to manipulate the arc
6442 :rtype: int | None
6443 """
6444 converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1])
6445 converted_bottom_right = self._convert_xy_to_canvas_xy(bottom_right[0], bottom_right[1])
6446 tkstyle = tk.PIESLICE if style is None else style
6447 if self._TKCanvas2 is None:
6448 print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***')
6449 print('Call Window.Finalize() prior to this operation')
6450 return None
6451 try: # in case closed with X
6452 id = self._TKCanvas2.create_arc(converted_top_left[0], converted_top_left[1], converted_bottom_right[0],
6453 converted_bottom_right[1], extent=extent, start=start_angle, style=tkstyle,
6454 outline=arc_color, width=line_width, fill=fill_color)
6455 except Exception as e:
6456 print('Error encountered drawing arc.', e)
6457 id = None
6458 return id
6459
6460 def draw_rectangle(self, top_left, bottom_right, fill_color=None, line_color=None, line_width=None):
6461 """

Callers 2

update_meterFunction · 0.80

Calls 1

Tested by

no test coverage detected