Skip to content

Commit 479e423

Browse files
committed
Add Python example to show Tkinter integration
1 parent d0b6d8a commit 479e423

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

example.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import tkinter as tk
2+
from tkinter import ttk
3+
4+
window = tk.Tk()
5+
style = ttk.Style(window)
6+
window.eval("set dir /usr/lib/tcltk/gtkTtk0.5; source /usr/lib/tcltk/gtkTtk0.5/pkgIndex.tcl")
7+
window.tk.call("package", "require", "ttk::theme::gtkTtk");
8+
print(style.theme_names())
9+
10+
style.theme_use("gtkTtk")
11+
ttk.Button(window, text="Destroy", command=window.destroy).pack()
12+
13+
window.mainloop()
14+

0 commit comments

Comments
 (0)