views:

25

answers:

1

I know how to make an image a button in Tkinter, now how do I make th image a toggle button similar to a radio button?

+1  A: 

Use a checkbutton with "indicatoron" set to False. This will turn off the little checkbox so you only see the image (or text), and the relief will toggle between raised and sunken each time it is clicked.

Another way is to use a label widget and manage the button clicks yourself. Add a binding for <1> and change the relief to sunken if raised, and raised if sunken. It's easier to use the built-in features of the checkbutton, since it also handles keyboard traversal, activation, etc.

Bryan Oakley