forked from formazione/tkinter_dark_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdark_theme.py
More file actions
39 lines (31 loc) · 1 KB
/
dark_theme.py
File metadata and controls
39 lines (31 loc) · 1 KB
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
# coding: utf-8
import tkinter as tk
import tkinter.ttk as ttk
import azure_dark
def main_window():
""" The window with the darkstyle """
root = tk.Tk()
azure_dark.apply_theme(root)
root.title("My App")
root.resizable(False, False)
img = tk.PhotoImage(file="001.png")
lab = ttk.Label(
root,
text="Hello World",
compound="center",
font="arial 50",
image=img
)
lab.pack(fill="both", expand=1)
b = tk.BooleanVar()
for widget in [
ttk.Button(root, text="Button 1", style="Accentbutton"),
ttk.Button(root, text="Button 2"),
ttk.Button(root, text="Button 3"),
ttk.Button(root, text="Button 4"),
ttk.Checkbutton(root, text='Checkbutton 1', variable=b ),
ttk.Checkbutton(root, text='Checkbutton 2', variable=b, style='Togglebutton'),
ttk.Checkbutton(root, text='Checkbutton 3', variable=b, style='Switch' ),
]: widget.pack()
root.mainloop()
main_window()