Apr-07-2020, 05:38 PM
For context; this is part of an application which is creating various plots using inputted data.
The advanced options will show and hide once, but will thereafter do nothing.
Simplest code is below. Any help would be superb.
The advanced options will show and hide once, but will thereafter do nothing.
Simplest code is below. Any help would be superb.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import tkinter as tk from tkinter import * root = Tk() global optionsVar optionsVar = IntVar() Checkbutton(root, text = "Show advanced options" , variable = optionsVar).grid() options_frame = Frame(root) options_frame.grid() def options_callback( * args): if optionsVar.get() = = 1 : Label(options_frame, text = "Here you will see advanced options" ).grid(row = 0 , column = 0 ) else : options_frame.grid_forget() optionsVar.trace( "w" , options_callback) root.mainloop() |