Tk Library Source Code

Check-in [561d20d565]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tsw: Extended the reference manual by a section about choosing between toggleswitch and (ttk::)checkbutton widgets.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 561d20d565a86eca97abb003ba01df35508021ee456ccb5e282f5920e6dfeaca
User & Date: csaba 2025-05-27 10:32:12.341
Context
2025-05-27
19:38
Scrollutil: Updated a screenshot. check-in: 890b173374 user: csaba tags: trunk
10:32
Tsw: Extended the reference manual by a section about choosing between toggleswitch and (ttk::)checkbutton widgets. check-in: 561d20d565 user: csaba tags: trunk
2025-05-23
19:44
Tablelist: Made the column deletion by orders of magnitude faster. check-in: 941b5bfe92 user: csaba tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to modules/tsw/CHANGES.txt.
9
10
11
12
13
14
15



16
17
18
19
20
21
22
23
2. For further compatibility with the (ttk::)checkbutton, invoking the
   "switchstate" subcommand with the optional argument now has no effect
   if the widget's "disabled" state flag is set.

3. Several further improvements in the code and the demo script
   "EditingOpts.tcl".




4. Improved the documentation by extending the CSS stylesheet used in
   the HTML files.

What was new in Tsw 1.0?
------------------------

This is the first release.  Thanks to Nicolas Bats for his early
testing and proposing the support for the "-variable" toggleswitch







>
>
>
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2. For further compatibility with the (ttk::)checkbutton, invoking the
   "switchstate" subcommand with the optional argument now has no effect
   if the widget's "disabled" state flag is set.

3. Several further improvements in the code and the demo script
   "EditingOpts.tcl".

4. Extended the reference manual by a section about choosing between
   toggleswitch and (ttk::)checkbutton widgets.

5. Improved the documentation by extending the CSS stylesheet used in
   the HTML files.

What was new in Tsw 1.0?
------------------------

This is the first release.  Thanks to Nicolas Bats for his early
testing and proposing the support for the "-variable" toggleswitch
Added modules/tsw/doc/compare.png.

cannot compute difference between binary files

Changes to modules/tsw/doc/toggleswitch.html.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34



35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
  <title>The tsw::toggleswitch Command</title>
  
  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content="toggleswitch, widget">
    
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
    
<body>
  <div>
    <h1>The <code><b>tsw::toggleswitch</b></code> Command</h1>

    <h2>For Tsw Version 1.1</h2>

    <h3>by</h3>
    
    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
    </address>
  </div>

  <hr>
    
  <h2 id="contents">Contents</h2>

  <ul>
    <li><a href="#quick_ref">Quick Reference</a></li>
    
    <li><a href="#detailed_ref">Detailed Reference</a></li>



  </ul>

  <div>
    <p><a href="index.html">Start page</a></p>
  </div>

  <hr>




|

|
|


|







|








|




|

>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
  <title>The tsw::toggleswitch Command</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content="toggleswitch, checkbutton, widget">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>tsw::toggleswitch</b></code> Command</h1>

    <h2>For Tsw Version 1.1</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
    </address>
  </div>

  <hr>

  <h2 id="contents">Contents</h2>

  <ul>
    <li><a href="#quick_ref">Quick Reference</a></li>

    <li><a href="#detailed_ref">Detailed Reference</a></li>

    <li><a href="#choosing">Choosing between toggleswitch and
    (ttk::)checkbutton</a></li>
  </ul>

  <div>
    <p><a href="index.html">Start page</a></p>
  </div>

  <hr>
596
597
598
599
600
601
602
603
604
605
606
607
608





































609
610
611
612
613
614
615
        <li class="tm">When the widget has the input focus, the
        <code>space</code> key causes its switch state to get toggled.</li>
      </ol>
    </dd>

    <dd class="tm">If the widget's <code><b>disabled</b></code> state flag is
    set then none of the above actions occur.</dd>
        
    <dt class="tm" id="keywords"><b>KEYWORDS</b></dt>

    <dd>toggleswitch, widget</dd>
  </dl> 
        





































  <div> 
    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
    "index.html">Start page</a></p>
  </div>
</body> 
</html>








|




|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






<
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654

        <li class="tm">When the widget has the input focus, the
        <code>space</code> key causes its switch state to get toggled.</li>
      </ol>
    </dd>

    <dd class="tm">If the widget's <code><b>disabled</b></code> state flag is
    set then none of the above actions occur.</dd>

    <dt class="tm" id="keywords"><b>KEYWORDS</b></dt>

    <dd>toggleswitch, widget</dd>
  </dl> 

  <div> 
    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
    "index.html">Start page</a></p>
  </div>

  <hr>

  <h2 id="choosing">Choosing between toggleswitch and (ttk::)checkbutton</h2>

  <p>This section is based on the Microsoft Learn article <i><a href=
  "https://learn.microsoft.com/en-us/windows/apps/design/controls/toggles">
  Toggle switches</a></i>.</p>

  <p>For some actions, either a toggleswitch or a checkbutton might work.&nbsp;
  To decide which control would work better, follow these tips:</p>

  <ul>
    <li class="tm">
      Use a toggleswitch for binary settings that work like actions by taking
      effect immediately after the user flips the switch.

      <p>In the following example, for turning the kitchen lights on, you
      should use a toggleswitch rather than a checkbutton.</p>

      <p><img src="compare.png" alt="compare" width="164" height="97"></p>
    </li>

    <li class="tm">For optional ("nice to have") items use checkbuttons.</li>

    <li class="tm">Use checkbuttons when the user can select multiple items
    that are related to a single setting or feature.</li>

    <li class="tm">Use a checkbutton when the user has to perform extra steps
    for changes to be effective.&nbsp; For example, if the user must click a
    "Submit" or "Next" button to apply changes, use a checkbutton.</li>
  </ul>

  <div> 
    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
    "index.html">Start page</a></p>
  </div>
</body> 
</html>

Changes to modules/tsw/doc/tsw.html.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</head>

<body>
  <div>
    <h1>Tsw Programmer's Guide</h1>

    <h2>For Tsw Version 1.1</h2>
    
    <h3>by</h3>
    
    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
    </address>
  </div>
  
  <hr>

  <h2 id="contents">Contents</h2>

  <h4><a href="#overview">Overview</a></h4>

  <ul>







|

|






|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</head>

<body>
  <div>
    <h1>Tsw Programmer's Guide</h1>

    <h2>For Tsw Version 1.1</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
    </address>
  </div>

  <hr>

  <h2 id="contents">Contents</h2>

  <h4><a href="#overview">Overview</a></h4>

  <ul>
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
  the <code>auto_path</code> variable.&nbsp; For example, you can install it as
  a subdirectory of the <code>lib</code> directory within your Tcl/Tk
  installation (at the same level as the <code>tk8.X</code> or
  <code>tk9.X</code> subdirectory).</p>

  <p>To install Tsw <i>on UNIX</i>, <code>cd</code> to the desired directory
  and unpack the distribution file <code>tsw1.1.tar.gz</code>:</p>
  
  <blockquote>
    <pre>
gunzip -c tsw1.1.tar.gz | tar -xf -
</pre>
  </blockquote>

  <p>On most UNIX systems this can be replaced with</p>







|







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
  the <code>auto_path</code> variable.&nbsp; For example, you can install it as
  a subdirectory of the <code>lib</code> directory within your Tcl/Tk
  installation (at the same level as the <code>tk8.X</code> or
  <code>tk9.X</code> subdirectory).</p>

  <p>To install Tsw <i>on UNIX</i>, <code>cd</code> to the desired directory
  and unpack the distribution file <code>tsw1.1.tar.gz</code>:</p>

  <blockquote>
    <pre>
gunzip -c tsw1.1.tar.gz | tar -xf -
</pre>
  </blockquote>

  <p>On most UNIX systems this can be replaced with</p>