Hi complete noob but i've been banging my head against this for 2 days and still can't work out what i'm doing wrong
So i am trying to setup a stack of side button/tabs which change image once clicked, effectively like a radio button just with custom images.
I am seemingly able to get the button's allocated image to change but am not "visual" seeing the change; as in the button image stays the same as first packed. I feel like some sort of update/refresh or "please don't garbage code" or some such is required, root.Update() does nothing and button.update() returns an error.
I feel like i'm making some fundamental error of understanding and just can't narrow down the correct question to ask.
this is a paired down version of what i'm trying to do just using 1 button, but with the back bone to expand to multiple buttons should i work out a fix.
So i am trying to setup a stack of side button/tabs which change image once clicked, effectively like a radio button just with custom images.
I am seemingly able to get the button's allocated image to change but am not "visual" seeing the change; as in the button image stays the same as first packed. I feel like some sort of update/refresh or "please don't garbage code" or some such is required, root.Update() does nothing and button.update() returns an error.
I feel like i'm making some fundamental error of understanding and just can't narrow down the correct question to ask.
this is a paired down version of what i'm trying to do just using 1 button, but with the back bone to expand to multiple buttons should i work out a fix.
import tkinter from tkinter import * from tkinter import ttk root = Tk() root.title("tab tester") root.geometry('800x480') def Change_Tab(whichTab): Tab_0_toggle.set(not Tab_0_toggle.get()) print(Tab_0_toggle.get()) print(Tab_0_icon[Tab_0_toggle.get()]) return Tab_0_toggle = IntVar() Tab_0_toggle.set(False) Tab_0_icon = [PhotoImage(file='Images\GUI_Tab_Data_Back_sml.png'),PhotoImage(file='Images\GUI_Tab_Data_Active_sml.png')] Tab_0 = Button(root, image=Tab_0_icon[Tab_0_toggle.get()] , command= lambda: Change_Tab(0)).pack()any advice would be most welcome