import sqlite3
from tkinter import *

# Window configuration

window = Tk()

window.title("One touch bar - Restaurant menu")
window.resizable(False, False)
window.config(bd = 25, relief = "sunken")

Label(window, text = "One touch bar", fg = "darkblue", font = ("Times New Roman",28, "bold italic")).pack()
Label(window, text = "Day menu", fg = "darkblue", font = ("Times New Roman", 24, "bold italic")).pack()

connection = sqlite3.connect("restaurant.db")
cursor = connection.cursor()
query = "SELECT * FROM category"
execute = cursor.execute(query)
categories = execute.fetchall()

for category in categories:

    Label(window, text = "=== {} ===".format(category[1]), fg = "darkblue", font = ("Times New Roman", 20, "bold italic")).pack()
    query = "SELECT * FROM plate WHERE category_id = {}".format(category[0])
    execute = cursor.execute(query)
    plates = execute.fetchall()
    for plate in plates:
        Label(window, text = "{}".format(plate[1]), fg = "black", font = ("Times New Roman", 18, "bold italic")).pack()
    
    # Categories separation

    Label(window, text = "").pack()
    
window.mainloop()