Skip to content
Sora edited this page Oct 6, 2024 · 6 revisions

Command - Label

Previously, Tkinter required more than two lines of code to place a text label. We are reforming that.

The Simplest Code

import tki
import tkinter as tk

root = tk.Tk()
tki.label(f=root, t_s="10", t="Test")

root.mainloop()

Inputs:

Req Name type description
must t_s string Text Size
must t string Text
must f None Type Frames
optional m int Modes(Tell About more later)
optional fnt string Font
optional x int Label Place(x)
optional x int Label Place(y)
optional tag string Label Tag
optional anchor tk.[PLACE] Label Place(About)
optional width int Label width
optinal heignt int Label height

Modes:

Generally, it was necessary to do [object].pack() to place from the top and [object].place() to specify.

For example, to place from the top, you would need to set mode=0 (the default value) and to specify, you would need to set mode=1 and specify x and y.

Clone this wiki locally