ttk::scale(n)
π NAME π
okay so bestie, this is the ttk::scale page from the n manual, filed under Tk Themed Widget β and it's literally here to create and manipulate a scale widget. slay. π
β¨ SYNOPSIS β¨
ttk::scale pathName ?options...?
π¦ DESCRIPTION π¦
A ttk::scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. No cap, a scale displays a slider that can be moved along over a trough, with the relative position of the slider over the trough indicating the value of the variable. it's giving "interactive numeric vibe" and honestly? iconic. π
πΈ STANDARD OPTIONS πΈ
the standard options are right here, bestie:
-class-cursor-style-takefocus
See the ttk_widget manual entry for details on the standard options.
π WIDGET-SPECIFIC OPTIONS π
-commandβ command-line name:-command; database name:command; database class:Command. Specifies the prefix of a Tcl command to invoke whenever the scale's value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale.-fromβ command-line name:-from; database name:from; database class:From. A real value corresponding to the left or top end of the scale.-lengthβ command-line name:-length; database name:length; database class:Length. Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable toTk_GetPixels). For vertical scales this is the scale's height; for horizontal scales it is the scale's width.-orientβ command-line name:-orient; database name:orient; database class:Orient. Specifies the orientation: whether the widget should be laid out horizontally or vertically. Must be eitherhorizontalorverticalor an abbreviation of one of these.-toβ command-line name:-to; database name:to; database class:To. Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the-fromoption.-valueβ command-line name:-value; database name:value; database class:Value. Specifies the current floating-point value of the variable. If-variableis set to an existing variable, specifying-valuehas no effect (the variable value takes precedence).-variableβ command-line name:-variable; database name:variable; database class:Variable. Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value.
π WIDGET COMMAND π
In addition to the standard cget, configure, identify element, instate, state and style commands (see ttk::widget), scale widgets support the following additional commands:
pathName get ?x y?β Get the current value of the-valueoption, or the value corresponding to the coordinatesx,yif they are specified.Xandyare pixel coordinates relative to the scale widget origin.pathName set valueβ Set the value of the widget (i.e. the-valueoption) tovalue. The value will be clipped to the range given by the-fromand-tooptions. Note that setting the linked variable (i.e. the variable named in the-variableoption) does not cause such clipping.
π₯ INTERNAL COMMANDS π₯
pathName coords ?value?β Get the coordinates corresponding tovalue, or the coordinates corresponding to the current value of the-valueoption ifvalueis omitted.
π§ STYLING OPTIONS π§
The class name for a ttk::scale is TScale.
Dynamic states: active.
TScale styling options configurable with ttk::style are:
-background color-borderwidth amount-darkcolor color-groovewidth amount-lightcolor color-sliderwidth amount-troughcolor color-troughrelief relief
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
π SEE ALSO π
ttk::widget(n)scale(n)
π KEYWORDS π
scaleslidertroughwidget
okay that's a wrap, bestie! π the footer source/version is Tk 8.5, the manual name is ttk::scale(n), and there's no date line in this footer, so I'm not inventing one β no cap, periodt. π«Ά
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 2008 Donal Fellows
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms