Thursday, September 22, 2022

Connected

 Tkcalendar is now connected to a sqlite databas:


*     *     *

It's really rather clever how the database works. The whole open-to-close protocol

for SQlite is invoked initially to create the DB, then the creation part is commented

out: no overwrite problem. Subsequently, one opens and closes the connection

on each function that interacts with it. 


What I had trouble with was getting the date as a datetime.date object type.

This is what the tkcalendar code requires to create a calevent and turn the date

pink. Turns out there is a built-in function for this within the datetime module. 

Below:



The Set_State function is on the Activate button. The calendar is initially

unresponsive and needs to be 'activated'. Paff! the date turns pink...

                                                               

There is more work to do, like getting the Set_State function loop through

all the dates, with a variety of tag colors. Might keep it to two!


The layout needs work. I ended up putting the calendar image in a Frame on the

top of the page, which doesn't disturb the grid settings lower down. Need to

get clear on how to dispose and align things...



No comments: