from tkinter import ttk

from .. import display
from .. import highscores

from . import tk_util



def main_gui():
	window = ttk.Frame( display.tkroot, padding=5 )
	window.grid()

	for k, score in enumerate(highscores.highscores):
		tk_util.Label( window, f"{k+1}:"         ).set_grid( 0, k, sticky="e" )
		tk_util.Label( window, score.name        ).set_grid( 1, k, sticky="w" )
		tk_util.Label( window, "~"               ).set_grid( 2, k, sticky="w" )
		tk_util.Label( window, str(score.points) ).set_grid( 3, k, sticky="e" )

	display.tk_main(window.destroy)
