]> vault307.fbx.one Git - mu_code.git/blob - monthlyChecklist.py
early learning in mu editor
[mu_code.git] / monthlyChecklist.py
1 import tkinter as tk
2 from tkinter import ttk
3 import datetime
4
5 month=(datetime.date.today()).strftime("%B") # get current MONTH
6
7 window=tk.Tk()
8 window.title(month) # title is current MONTH
9 content=tk.StringVar()
10 reminder=[] # button list
11 item=[] # list of input from entry
12 cOntent=content.get()
13 count=0
14 style=ttk.Style()
15 style.theme_use('default')
16 style.configure('styled.TButton',foreground='blue',background='yellow')
17 style.map('styled.TButton',
18 foreground=[('pressed','red'),('focus','green'),('disabled','yellow')],
19 background=[('active','yellow'),('disabled','blue')])
20
21 reminderEntry=ttk.Entry(window, textvariable=content)
22 reminderEntry.grid(row=0,column=0)
23
24 def clear_entry():
25 reminderEntry.delete(0,'end')
26 def add():
27 global content
28 cOntent=content.get()
29 global count
30 reminder.append(ttk.Button(window,text=cOntent,command=lambda :done(),
31 style='styled.TButton'))
32
33 def done():
34 for i in range(len(cOntent)):
35 reminder[i].configure(text=reminder[i]['text']+" DONE",
36 state='disabled')
37 print((reminder[i]).configure())
38
39 reminder[-1].grid(row=count+2,column=0,sticky='nsew')
40 count += 1
41 clear_entry()
42
43
44
45 add=tk.Button(window,text='Add',command=add)
46 add.grid(row=1,column=0)
47 print(window.grid_slaves(),cOntent)
48 window.mainloop()