Getting the fill color or any other property of a item drawn in a canvas in tkinter(Python) -
i want fill color or other property of item drawn in canvas in tkinter.
def createwidgets(self): self.canvas_1= tk.canvas(self, bg='#fafafa',selectforeground='#bbdefb'); i=self.canvas_1.create_rectangle((self.canvas_1.winfo_reqwidth()/2)+100, (self.canvas_1.winfo_reqheight()/2)+50, (self.canvas_1.winfo_reqwidth()/2)+150, (self.canvas_1.winfo_reqheight()/2)+100, fill='#ff4081',width=0) self.canvas_1.grid(); color= #want access fill color of item using getter functions.
Comments
Post a Comment