RadioSelect with image
Question:
Is it possible for Pmw.RadioSelect’s buttons to have an icon next to the text? Supposing we have a few buttons added in a Frame, each one of them has different icon on left or right side of text.
Answers:
You can add images to RadioButton widgets by doing this:
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()
Check out Radiobutton documentation for more info.
Is it possible for Pmw.RadioSelect’s buttons to have an icon next to the text? Supposing we have a few buttons added in a Frame, each one of them has different icon on left or right side of text.
You can add images to RadioButton widgets by doing this:
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()
Check out Radiobutton documentation for more info.