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.

Asked By: user5108497

||

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.

Answered By: PyDer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.