我想得到填充颜色或在画布上绘制的项目的任何其他属性 在特金特。在
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 to access the fill color of item i using some getter functions.
您可以使用
itemcget
方法来执行此操作:effbot
所以你可以使用:
下面是一个关于如何获得矩形填充颜色的小例子。。。在
相关问题 更多 >
编程相关推荐