Return self.create_arc(x-r, y-r, x+r, y+r, **kwargs) If "start" in kwargs and "end" in kwargs: Return self.create_oval(x-r, y-r, x+r, y+r, **kwargs)ĭef _create_circle_arc(self, x, y, r, **kwargs): try:Ĭanvas = tk.Canvas(root, width=200, height=200, borderwidth=0, highlightthickness=0,ĭef _create_circle(self, x, y, r, **kwargs): Please leave a url to your project/example so we can check it out. Would it be possible to base the size of the circle off the text element (size, character/word count) somehow Be great to see what you come up with Mark. We do something similar for create_arc (fourth paragraph), and give the option to specify an end angle instead of an extent. Possibly use shape-margin to increase the exclusion areas Forcing the text towards the middle. Add it to your code and you can treat tk.Canvas.create_circle(x, y, r, options.) as you would a builtin method, where the options are the same as create_oval. Below is a fully-functioning program (Python 2.7 and 3.x), of which the third paragraph is of interest. Here's a trick known as monkey patching where we actually add a member to the tkinter/ Tkinter class Canvas.
0 Comments
Leave a Reply. |