tk scaling
Gives or sets the count of pixels in one point.
tk scaling ?FACTOR?
Description
The factor converts points and other units of length to pixels, such as the size of a font in points and a distance such as 1i. The default is 1.3333333333333333: 96 pixels for each inch. The pixels are logical pixels, and the backend draws each one with the scale of the screen.
With FACTOR, sets the factor and lays out each widget again. FACTOR must be more than 0 and at most 100.
Returns
The factor, or an empty string after a change.
Examples
% set px [winfo pixels . 1i]
> tk scaling 2.0
> list $px [winfo pixels . 1i] [tk scaling]
96 144 2.0
Errors
% tk scaling big
expected floating-point number but got "big"
-errorcode NONE
% tk scaling 0
expected floating-point number but got "0"
-errorcode NONE
% tk scaling -displayof . 2
wrong # args: should be "tk scaling ?-displayof window? ?factor?"
-errorcode TCL WRONGARGS
Differences from Tcl
tk scaling -displayof WINDOWis an error. Tk 8.6.16 accepts the option.- The default is 1.3333333333333333 on each platform. Tk 8.6.16 on X11 gets the factor from the size of the screen.
- A FACTOR of 0 or less, or more than 100, is an error. Tk 8.6.16 accepts it.
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1