Skip to content Skip to sidebar Skip to footer

Tkinter Menu And Buttons

I'm trying to make a Tkinter menu that is like a taskbar checker. So if I go to this menu and check a box, a specific button then appears on my window, and then the user can select

Solution 1:

gridData = {}
gridData[button] = [row,col]


def Toggle_Button(myButton):
    if myButton.winfo_ismapped()==1:
    myButton.grid_forget()
else:
    myButton.grid(row=gridData[myButton][0],column=gridData[myButton][1])

If you already have buttons on a grid, use button.grid_info to find what you need, it returns a dictionary.


Post a Comment for "Tkinter Menu And Buttons"