Entry and spinbox

Live: the Text input card of the gallery.

entry

set name "Ada Lovelace"
entry .name -textvariable name -width 22
entry .pw -show * -width 22
entry .search -width 22 -placeholder "Search files"
ztk::class .search add search
pack .name .pw .search -padx 12 -pady 4
An entry with the text Ada Lovelace, an empty password entry, and a round search field with the placeholder Search files
Live

Validation

Validation follows Tk: the modes, the % fields, and -invalidcommand.

entry .qty -validate key -validatecommand {string is integer %P} -invalidcommand bell
pack .qty -padx 12 -pady 4
The live window shows here.
Live

spinbox

spinbox .copies -from 1 -to 99 -width 6
spinbox .size -values {Small Medium Large} -state readonly -width 10
.size set Medium
pack .copies .size -padx 12 -pady 4
A spinbox with the number 1 and a readonly spinbox with the text Medium
Live

A spinbox has -format, -wrap, -command, and the repeat of a held button. The buttons are the parts ::buttonup and ::buttondown in CSS.