-
Notifications
You must be signed in to change notification settings - Fork 1
create_circle()
Luke edited this page Apr 12, 2020
·
3 revisions
create_oval kinda sucks (ngl); it is much more intuitive to use this method.
from numbers import Real
def create_circle(self, x: Real, y: Real, radius: Real, **kwargs) -> int
Creates a circle with the centre x
, y
, and a radius, rather than create_oval(x1, y1, x2, y2, **kwargs)
, which can be unintuitive to use in many situations.
from tkinter import Tk
from CanvasPlus import CanvasPlus
root = Tk()
canvas = CanvasPlus(root, width=800, height=800, background = "white")
canvas.pack()
canvas.create_circle(300, 300, 100, fill = "black", outline = "green", width = 3)
canvas.create_circle(300, 100, 75, fill = "#373737", outline = "red")
canvas.create_circle(500, 500, 5, fill = "blue", outline = "grey50", width = 1)
canvas.update()
canvas.mainloop()
Copyright (C) 2020 Luke Zhang
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the conditions at https://github.com/Luke-zhang-04/CanvasPlus/blob/master/LICENSE.