2024-06-02 08:54:01 发布
网友
有可能吗Pmw.无线电选举的按钮在文本旁边有一个图标吗?假设我们在一个框架中添加了几个按钮,每个按钮在文本的左侧或右侧都有不同的图标。在
您可以通过执行以下操作将图像添加到RadioButton小部件:
from tkinter import * root = Tk() radiobtn = Radiobutton(root) # Image location (add "/" not "\") img = PhotoImage(file="C:/path to image/image.png") # Applying image to the Radiobutton radiobtn.config(image=img) # Display Radiobutton radiobtn.pack() root.mainloop()
查看Radiobutton documentation了解更多信息。在
您可以通过执行以下操作将图像添加到RadioButton小部件:
查看Radiobutton documentation了解更多信息。在
相关问题 更多 >
编程相关推荐