Basically you need to use an IntVar to set/get the status of tkinter widgets.
Code: Select all
try:
import tkinter as tk
import tkinter.ttk as ttk
except:
import Tkinter as tk
import ttk
import time
class App(tk.Frame):
def __init__(self,master=None,**kw):
tk.Frame.__init__(self,master=master,**kw)
self.value = tk.IntVar()
self.checkBox1 = ttk.Checkbutton(self, text="Invisible", variable = self.value)
self.checkBox1.grid()
self.after(5000,self.setBox)
def setBox(self):
self.value.set(1)
if __name__ == '__main__':
root = tk.Tk()
App(root).grid()
root.mainloop()