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

Method draw_point

PySimpleGUI/PySimpleGUI.py:6325–6356  ·  view source on GitHub ↗

Draws a "dot" at the point you specify using the USER'S coordinate system :param point: Center location using USER'S coordinate system :type point: (int, int) | Tuple[float, float] :param size: Radius? (Or is it the diameter?) in user's coordinate values. :

(self, point, size=2, color='black')

Source from the content-addressed store, hash-verified

6323 return id
6324
6325 def draw_point(self, point, size=2, color='black'):
6326 """
6327 Draws a "dot" at the point you specify using the USER'S coordinate system
6328 :param point: Center location using USER'S coordinate system
6329 :type point: (int, int) | Tuple[float, float]
6330 :param size: Radius? (Or is it the diameter?) in user's coordinate values.
6331 :type size: int | float
6332 :param color: color of the point to draw
6333 :type color: (str)
6334 :return: id returned from tkinter that you'll need if you want to manipulate the point
6335 :rtype: int | None
6336 """
6337 if point == (None, None):
6338 return
6339 converted_point = self._convert_xy_to_canvas_xy(point[0], point[1])
6340 size_converted = self._convert_xy_to_canvas_xy(point[0] + size, point[1])
6341 size = size_converted[0] - converted_point[0]
6342 if self._TKCanvas2 is None:
6343 print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***')
6344 print('Call Window.Finalize() prior to this operation')
6345 return None
6346 try: # needed in case window was closed with an X
6347 point1 = converted_point[0] - size // 2, converted_point[1] - size // 2
6348 point2 = converted_point[0] + size // 2, converted_point[1] + size // 2
6349 id = self._TKCanvas2.create_oval(point1[0], point1[1],
6350 point2[0], point2[1],
6351 width=0,
6352 fill=color,
6353 outline=color)
6354 except:
6355 id = None
6356 return id
6357
6358 def draw_circle(self, center_location, radius, fill_color=None, line_color='black', line_width=1):
6359 """

Callers 3

mainFunction · 0.80
mainFunction · 0.80

Calls 1

Tested by

no test coverage detected