TKinter
The internal GUI library for python.
from tkinter import Tk
from tkinter.ttk import Button, Label
import sv_ttk
root = Tk()
def on_clickme_clicked():
my_label.text="You clicked!"
button = Button(root, text="Click me!", command=on_clickme_clicked)
button.pack()
my_label = Label(root)
my_label.text="Click."
my_label.pack()
# This where the magic happens
sv_ttk.set_theme("dark")
root.mainloop()
References
Layouts
In TKinter, layout functions are called "geometry managers".
Geometry managers employ a packer function to figure out relative positioning. Widgets don't appear before they have their geometry specified with a geometry manager, which is the .pack()-function.
Main GUI Elements: Widgets
ttk.Widget defines standard options and methods supported by Tk themed widgets and is not supposed to be directly instantiated.
ttk stands for "Themed TKinter" and modern alternatives for many of the classic widgets.
Ttk comes with 18 widgets, twelve of which already existed in tkinter: Button, Checkbutton, Entry, Frame, Label, LabelFrame, Menubutton, PanedWindow, Radiobutton, Scale, Scrollbar, and Spinbox. The other six are new: Combobox, Notebook, Progressbar, Separator, Sizegrip and Treeview. And all them are subclasses of Widget.
| Button | A general button | |
| Checkbutton | A boolean input option | |
| Entry | A text window for user input | |
| Frame | ||
| Label | ||
| LabelFrame | ||
| Menubutton | Part of a menu | |
| PanedWindow | ||
| Radiobutton | ||
| Scale | ||
| Scrollbar | ||
| Spinbox | ||
| Combobox | ||
| Notebook | ||
| Progressbar | ||
| Seperator | ||
| Sizegrip | ||
| Treeview |