我正在用Tkinter Python3.4制作一个TreeView,我添加了一个chrome徽标,但图像从未出现过。在
treeview=ttk.Treeview(frame3)
chromelogo=PhotoImage(file="./Images/minor-logo.png")
chromelogo=chromelogo.subsample(10,10)
treeview.pack(fill=BOTH,expand=True)
treeview.insert('','0','Chrome',text='Chrome', image=chromelogo)
treeview.insert('Chrome','0',"shit",text="shit",image=chromelogo)
treeview.insert('','1','Chrome3',text='Chrome3')
{a1}图标链接
Photoimage不允许您打开图像而不是gif类型,如果您想在tkinter中打开图像而不是gif,请尝试PIL模块。您可以使用任何方法来安装PIL模块,我喜欢命令行
由于您希望您的图像在树状视图中的脚部,请使用此选项来调整大小并将其插入
^{pr2}$相关问题 更多 >
编程相关推荐