Tsw , by Csaba Nemethi, is a toggle switch widget package for Tcl/Tk 8.6 or higher, written in pure Tcl code.
The Tsw package contains:
A toggleswitch is a mega-widget consisting basically of a horizontal trough (a fully rounded filled rectangle) and a slider (a filled circle or fully rounded filled rectangle contained in the trunk). The widget also contains a ttk::label displaying an optional text to the trough'sleft; this child widget is only managed if the text specified with the "-text" or "-textvariable" option is a nonempty string.
A toggleswitch widget can have one of two possible switch states: on or off. In the on state the slider is placed at the end of the trough, and in the off state at its beginning. The user can toggle between these two states with the mouse or the space key.
You can use the switchstate subcommand of the Tcl command associated with a toggleswitch to change or query the widget's switch state. By using the -command configuration option, you can specify a script to execute whenever the switch state of the widget gets toggled. For compatibility with the (ttk::)checkbutton, toggleswitch widgets also support the -offvalue, -onvalue, and -variable options.
|
|
|
Jeff Smith 2026-07-04 : Below is an online demo using CloudTk. This demo runs "Tsw" in an Alpine Linux Docker Container. It is a 46.6MB image which is made up of Alpine Linux + tclkit + Tsw1.4.2.kit + libx11 + libxft + fontconfig + ttf-linux-libertine. It is run under a user account in the Container. The Container is restrictive with permissions for "Other" removed for "execute" and "read" for certain directories.
Jeff Smith 2025-03-28 : This demo now runs with Tcl9.
TWu - 2025-09-16 13:50:04
After discussion at virtual Munich Tcl User Group meeting, here my result of research and asking Arabic colleague:
Not only the text is written from right to left and therefore the paragraphs are right aligned,
also the graphics and symbols are swapped, especially where it will otherwise confuse the users (like arrows).
Please see for reference and source at https://github.com/shadeed/rtl-styling/issues/11
and complete overview at https://rtlstyling.com/posts/rtl-styling/
gold 8/30/2026. Added categories so can find page on Wiki.
| Category Numerical Analysis | Category Toys | Category Calculator | Category Mathematics | Category Example | Toys and Games | Category Games | Category Application | Category GUI |