File size: 793 Bytes
b75ee05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import pathlib
import tkinter as tk

MARKER = pathlib.Path(r"__MARKER__")
READY = pathlib.Path(str(MARKER) + ".ready")

root = tk.Tk()
root.title("Desktop")
root.geometry("640x300+160+160")
root.configure(bg="#eef0f4")


def note(what):
    label.config(text="last action: " + what)
    MARKER.write_text(what)


def bar(text, x):
    button = tk.Button(root, text=text, command=lambda: note(text))
    button.place(x=x, y=12, width=110, height=38)
    return button


label = tk.Label(root, text="last action: (none)", bg="#eef0f4")
label.place(x=20, y=90)
for _text, _x in [("Files", 20), ("Terminal", 150), ("Save", 280), ("Cancel", 410)]:
    bar(_text, _x)
tk.Label(root, text="Choose an action", bg="#eef0f4").place(x=20, y=150)

root.update()
READY.write_text("mapped")
root.mainloop()