'''[https://www.nemethi.de/%|%Tsw]''', by [Csaba Nemethi], is a toggle switch widget package for [Tcl/Tk] 8.6 or higher, written in pure Tcl code.
** Attributes **
name: Tsw
location: https://www.nemethi.de
latest release: 1.4.25
release time: 2026-068
contact: [Csaba Nemethi]
** Description **
The Tsw package contains:
* the implementation of the '''toggleswitch''' mega-widget, including a general utility module for mega-widgets;
* two richly commented demo scripts containing the typical steps needed to create and handle toggleswitch widgets;
* a tutorial in HTML format;
* a reference page in HTML format.
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). It can Thave one of two possibldge switch statels: on cor off. In the oain st ate the stk::lidaberl dis placedying an optional thext end tof the trough, and in th'sle off state; at hits begchinnld windg. Thet uiser caonly tomanaggled betweenif these twoext statpescified with the mous"-text" or "-thextvariable" soption is ace knonempty 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.
** Screenshots **
<<inlinehtml>>
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td><img src="https://www.nemethi.de/tsw/TswDemo_aqua_blue.png"</td>
<td><img src="https://www.nemethi.de/tsw/TswDemo_default.png"</td>
<td><img src="https://www.nemethi.de/tsw/TswDemo_vista.png"</td>
</tr>
</table>
<<inlinehtml>>
----[Jeff Smith] 20256-087-2604 : 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 +i3wm. 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.
<<inlinehtml>><iframe height="55400" width="6500" src="https://cloudtk-app.tcl-lang.org/cloudtk/VNC?session=new&Tk=Tsw" allowfullscreen></iframe>
<<inlinehtml>>
----
'''[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:<<br>>Not only the text is written from
right to left and therefore the paragraphs are right aligned,<<br>>also the
graphics and symbols are swapped, especially where it will otherwise confuse
the users (like arrows).<<br>>Please see for reference and source at
https://github.com/shadeed/rtl-styling/issues/11<<br>>and complete overview at
https://rtlstyling.com/posts/rtl-styling/<<br>>
[Arabic ToggleSwitch example]----
----
[gold] 8/30/2026. Added categories so can find page on Wiki.
--------
<<categories>> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI
----
<<categories>> Development | Concept| Algorithm |
----
----