-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
43 lines (32 loc) · 942 Bytes
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import time
import tkinter as tk
from runner import Runner
class GUI(Runner):
def __init__(self, config):
try:
from ctypes import windll
windll.shcore.SetProcessDpiAwareness(1)
except ImportError:
pass
super().__init__(config)
root = tk.Tk()
root.title("syllabes")
root.state("zoomed")
self.displayed_text = tk.StringVar()
tk.Label(
root,
textvariable=self.displayed_text,
justify="left",
anchor=tk.W,
width=80,
font=("Arial", config["font_size"]),
).pack()
self.root = root
def print(self, text):
self.displayed_text.set(self.displayed_text.get() + text)
self.root.update()
def pause(self, duration):
time.sleep(duration)
def clear(self):
self.displayed_text.set("")
self.root.update()