Tk Library Source Code

Check-in [3087430f43]
Login

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

Overview
Comment:Scrollutil, Tablelist: Minor corrections and improvements in the documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3087430f4393d4c319b86601a143f2839ad5fdfdce63d1bf4e4ba0f6e690f58d
User & Date: csaba 2025-06-09 11:23:14.527
Context
2025-06-10
15:11
Released Wcb 4.2. check-in: 74867d0014 user: csaba tags: trunk
2025-06-09
11:23
Scrollutil, Tablelist: Minor corrections and improvements in the documentation. check-in: 3087430f43 user: csaba tags: trunk
2025-06-07
17:09
Scrollutil: A series of changes. See the ChangeLog for details. check-in: bc89eb5c0f user: csaba tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to modules/scrollutil/doc/scrollutil.html.
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
    percentage will be set by the procedure
    <code>scaleutil::scalingPercentage</code> to <code>200</code>, otherwise it
    will be computed from the value of the font DPI, given by the X resource
    <code>Xft.dpi</code>.&nbsp; The value of the font DPI can be set in the
    <i>Fonts</i> tab of the <i>Appearance</i> dialog or (on Linux Lite 5+) via
    the <i>HiDPI Settings</i> dialog.</li>

    <li class="tm">On MATE</i>, the display scaling mode, called <i>window
    scaling factor</i>, can be "Auto-detect", "Regular", or "HiDPI", and can be
    selected in the <i>MATE Tweak</i> dialog.&nbsp; The same effect can be
    achieved by using the <i>Monitor Preferences</i> dialog and selecting one
    of the possible scaling values "auto detect", "100%", and "200%".&nbsp; If
    needed, the procedure <code>scaleutil::scalingPercentage</code>
    auto-detects which one of the "Regular" ("100%") and "HiDPI" ("200%") modes
    corresponds to the preset "Auto-detect" ("auto detect") mode.&nbsp; If the







|







554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
    percentage will be set by the procedure
    <code>scaleutil::scalingPercentage</code> to <code>200</code>, otherwise it
    will be computed from the value of the font DPI, given by the X resource
    <code>Xft.dpi</code>.&nbsp; The value of the font DPI can be set in the
    <i>Fonts</i> tab of the <i>Appearance</i> dialog or (on Linux Lite 5+) via
    the <i>HiDPI Settings</i> dialog.</li>

    <li class="tm">On <i>MATE</i>, the display scaling mode, called <i>window
    scaling factor</i>, can be "Auto-detect", "Regular", or "HiDPI", and can be
    selected in the <i>MATE Tweak</i> dialog.&nbsp; The same effect can be
    achieved by using the <i>Monitor Preferences</i> dialog and selecting one
    of the possible scaling values "auto detect", "100%", and "200%".&nbsp; If
    needed, the procedure <code>scaleutil::scalingPercentage</code>
    auto-detects which one of the "Regular" ("100%") and "HiDPI" ("200%") modes
    corresponds to the preset "Auto-detect" ("auto detect") mode.&nbsp; If the
1452
1453
1454
1455
1456
1457
1458
1459

1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
  <code><a href=
  "wheelEvent.html#adapt">scrollutil::adaptWheelEventHandling</a></code>
  command for every ttk::combobox widget, which is needed for a user-friendly
  event handling, being that this widget has built-in bindings for the mouse
  wheel and <code>&lt;TouchpadScroll&gt;</code> events.&nbsp; Due to this
  command, these events over one of the ttk::combobox widgets will only select
  the next/previous capital city if the widget has the focus, otherwise they
  will scroll the scrollableframe.&nbsp; For every ttk::combobox widget, we

  also invoke the <code><a href=
  "scrollableframe.html#adapt">scrollutil::adaptBtn2EventHandling</a></code>
  command, thus making sure that the mouse button 2 events sent to the widget
  will only be handled by the widget itself if it has the focus, otherwise they
  will result in scanning the scrollableframe's content.</p>

  <p>During the scan with mouse button 2, the cursor will take on the shape of
  a pointing hand, and by draggging the mouse, the content frame will drag at
  high speed through the window, in the direction the mouse moves.</p>

  <h3 id="ex_BwScrollableFrameDemo1">A Script Using a BWidget ScrollableFrame
  Widget</h3>

  <p>The script <code>BwScrollableFrmDemo1.tcl</code> in the <code>demos</code>
  directory creates a BWidget ScrollableFrame embedded into a <a href=
  "scrollarea.html">scrollarea</a> widget, creates mouse wheel and







|
>
|



|
<
|
|
|







1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465

1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
  <code><a href=
  "wheelEvent.html#adapt">scrollutil::adaptWheelEventHandling</a></code>
  command for every ttk::combobox widget, which is needed for a user-friendly
  event handling, being that this widget has built-in bindings for the mouse
  wheel and <code>&lt;TouchpadScroll&gt;</code> events.&nbsp; Due to this
  command, these events over one of the ttk::combobox widgets will only select
  the next/previous capital city if the widget has the focus, otherwise they
  will scroll the scrollableframe.</p>

  <p>For every ttk::combobox widget, we also invoke the <code><a href=
  "scrollableframe.html#adapt">scrollutil::adaptBtn2EventHandling</a></code>
  command, thus making sure that the mouse button 2 events sent to the widget
  will only be handled by the widget itself if it has the focus, otherwise they
  will result in scanning the scrollableframe's content.&nbsp; During the scan

  the cursor will take on the shape of a pointing hand, and by draggging the
  mouse, the content frame will drag at high speed through the window, in the
  direction the mouse moves.</p>

  <h3 id="ex_BwScrollableFrameDemo1">A Script Using a BWidget ScrollableFrame
  Widget</h3>

  <p>The script <code>BwScrollableFrmDemo1.tcl</code> in the <code>demos</code>
  directory creates a BWidget ScrollableFrame embedded into a <a href=
  "scrollarea.html">scrollarea</a> widget, creates mouse wheel and
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389

proc saveSel {nb widget} {
    . . .
}

<span class="cmt">#
# Create bindings for moving and closing the tabs interactively,
# as well as for the virtual event <<NotebookTabChanged>>
#</span>
<span class="red">bind $nb &lt;&lt;MenuItemsRequested&gt;&gt; { populateMenu %W %d }
bind $nb &lt;&lt;NotebookTabChanged&gt;&gt; { restoreSel %W }</span>

proc populateMenu {nb data} {
    . . .
}







|







2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389

proc saveSel {nb widget} {
    . . .
}

<span class="cmt">#
# Create bindings for moving and closing the tabs interactively,
# as well as for the virtual event &lt;&lt;NotebookTabChanged&gt;&gt;
#</span>
<span class="red">bind $nb &lt;&lt;MenuItemsRequested&gt;&gt; { populateMenu %W %d }
bind $nb &lt;&lt;NotebookTabChanged&gt;&gt; { restoreSel %W }</span>

proc populateMenu {nb data} {
    . . .
}
Changes to modules/scrollutil/doc/wheelEvent.html.
1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html>
<head>
  <title>Commands Related to Mouse Wheel and
  <code><b>&lt;TouchpadScroll&gt;</b></code> Event Handling</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scale widget, scrolling, scrollable widget container, focus">

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



|
|







1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html>
<head>
  <title>Commands Related to Mouse Wheel and &lt;TouchpadScroll&gt; Event
  Handling</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scale widget, scrolling, scrollable widget container, focus">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
Changes to modules/tablelist/doc/tablelist.html.
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
    percentage will be set by the procedure
    <code>scaleutil::scalingPercentage</code> to <code>200</code>, otherwise it
    will be computed from the value of the font DPI, given by the X resource
    <code>Xft.dpi</code>.&nbsp; The value of the font DPI can be set in the
    <i>Fonts</i> tab of the <i>Appearance</i> dialog or (on Linux Lite 5+) via
    the <i>HiDPI Settings</i> dialog.</li>

    <li class="tm">On MATE</i>, the display scaling mode, called <i>window
    scaling factor</i>, can be "Auto-detect", "Regular", or "HiDPI", and can be
    selected in the <i>MATE Tweak</i> dialog.&nbsp; The same effect can be
    achieved by using the <i>Monitor Preferences</i> dialog and selecting one
    of the possible scaling values "auto detect", "100%", and "200%".&nbsp; If
    needed, the procedure <code>scaleutil::scalingPercentage</code>
    auto-detects which one of the "Regular" ("100%") and "HiDPI" ("200%") modes
    corresponds to the preset "Auto-detect" ("auto detect") mode.&nbsp; If the







|







393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
    percentage will be set by the procedure
    <code>scaleutil::scalingPercentage</code> to <code>200</code>, otherwise it
    will be computed from the value of the font DPI, given by the X resource
    <code>Xft.dpi</code>.&nbsp; The value of the font DPI can be set in the
    <i>Fonts</i> tab of the <i>Appearance</i> dialog or (on Linux Lite 5+) via
    the <i>HiDPI Settings</i> dialog.</li>

    <li class="tm">On <i>MATE</i>, the display scaling mode, called <i>window
    scaling factor</i>, can be "Auto-detect", "Regular", or "HiDPI", and can be
    selected in the <i>MATE Tweak</i> dialog.&nbsp; The same effect can be
    achieved by using the <i>Monitor Preferences</i> dialog and selecting one
    of the possible scaling values "auto detect", "100%", and "200%".&nbsp; If
    needed, the procedure <code>scaleutil::scalingPercentage</code>
    auto-detects which one of the "Regular" ("100%") and "HiDPI" ("200%") modes
    corresponds to the preset "Auto-detect" ("auto detect") mode.&nbsp; If the
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
  "tablelistColSort.html#sortByColumn">tablelist::sortByColumn</a></code> and
  <code><a href=
  "tablelistColSort.html#addToSortColumns">tablelist::addToSortColumns</a></code>
  commands specified in these settings enable the user to sort the items by one
  or more columns, with the aid of the left mouse button and of the
  <code>Shift</code> key.</p>

  <p>
  <p>Notice also that we set the <code><a href=
  "tablelistWidget.html#col_allowduplicates">-allowduplicates</a></code> option
  of the column containing the names of the serial lines to false, in order to
  keep these names unique when editing them interactively.</p>

  <p>The file <code>serialParams.tcl</code>, which is <code>source</code>d into
  the main script, contains the following code, which is related mainly to







<







2513
2514
2515
2516
2517
2518
2519

2520
2521
2522
2523
2524
2525
2526
  "tablelistColSort.html#sortByColumn">tablelist::sortByColumn</a></code> and
  <code><a href=
  "tablelistColSort.html#addToSortColumns">tablelist::addToSortColumns</a></code>
  commands specified in these settings enable the user to sort the items by one
  or more columns, with the aid of the left mouse button and of the
  <code>Shift</code> key.</p>


  <p>Notice also that we set the <code><a href=
  "tablelistWidget.html#col_allowduplicates">-allowduplicates</a></code> option
  of the column containing the names of the serial lines to false, in order to
  keep these names unique when editing them interactively.</p>

  <p>The file <code>serialParams.tcl</code>, which is <code>source</code>d into
  the main script, contains the following code, which is related mainly to
Changes to modules/tablelist/doc/tablelistWidget.html.
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
    <i>itemList</i></code></dd>

    <dd><code><i>pathName</i> <b><a href="#attrib">attrib</a></b> ?<i>name</i>?
    ?<i>value</i> <i>name</i> <i>value</i> ...?</code></dd>

    <dd><code><i>pathName</i> <b><a href=
    "#autoscrolltarget">autoscrolltarget</a></b> <i>event</i>
    <i>x</i></code> <i>y</i></code></dd>

    <dd><code><i>pathName</i> <b><a href="#bbox">bbox</a></b>
    <i>index</i></code></dd>

    <dd><code><i>pathName</i> <b><a href=
    "#bodypath">bodypath</a></b></code></dd>








|







737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
    <i>itemList</i></code></dd>

    <dd><code><i>pathName</i> <b><a href="#attrib">attrib</a></b> ?<i>name</i>?
    ?<i>value</i> <i>name</i> <i>value</i> ...?</code></dd>

    <dd><code><i>pathName</i> <b><a href=
    "#autoscrolltarget">autoscrolltarget</a></b> <i>event</i>
    <i>x</i> <i>y</i></code></dd>

    <dd><code><i>pathName</i> <b><a href="#bbox">bbox</a></b>
    <i>index</i></code></dd>

    <dd><code><i>pathName</i> <b><a href=
    "#bodypath">bodypath</a></b></code></dd>

5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
              <th><code>classic100</code></th>
              <th><code>classic125</code></th>
              <th><code>classic150</code></th>
              <th><code>classic175</code></th>
              <th><code>classic200</code></th>
            </tr>
          </tbody>
          </tbody>
        </table>

        <p>If the tree style is <code><b>gtk</b></code>,
        <code><b>adwaita</b></code>, <code><b>blueMenta</b></code>,
        <code><b>ubuntu</b></code>, <code><b>ubuntu2</b></code>,
        <code><b>ubuntu3</b></code>, <code><b>mint</b></code>,
        <code><b>mint2</b></code>, <code><b>mate</b></code>,







<







5044
5045
5046
5047
5048
5049
5050

5051
5052
5053
5054
5055
5056
5057
              <th><code>classic100</code></th>
              <th><code>classic125</code></th>
              <th><code>classic150</code></th>
              <th><code>classic175</code></th>
              <th><code>classic200</code></th>
            </tr>
          </tbody>

        </table>

        <p>If the tree style is <code><b>gtk</b></code>,
        <code><b>adwaita</b></code>, <code><b>blueMenta</b></code>,
        <code><b>ubuntu</b></code>, <code><b>ubuntu2</b></code>,
        <code><b>ubuntu3</b></code>, <code><b>mint</b></code>,
        <code><b>mint2</b></code>, <code><b>mate</b></code>,
8004
8005
8006
8007
8008
8009
8010
8011

8012
8013
8014
8015
8016
8017
8018
8019
8020
8021

8022
8023
8024
8025
8026
8027
8028
          <td><code><b>&lt;&lt;TablelistXViewChanged&gt;&gt;</b></code></td>
          <td>Generated whenever the horizontal view in the tablelist widget's
          window changes (and the horizontal scrollbar, if any, is
          updated).</td>
          <td>A list consisting of the numerical indices of the leftmost and
          rightmost columns visible in the tablelist window, i.e., of the
          numerical equivalents of the <a href="#col_indices">column
          indices</a> <code><b>left</b></code> and <code><b>right</code>.</td>

        </tr>

        <tr valign="top">
          <td><code><b>&lt;&lt;TablelistYViewChanged&gt;&gt;</b></code></td>
          <td>Generated whenever the vertical view in the tablelist widget's
          window changes (and the vertical scrollbar, if any, is updated).</td>
          <td>A list consisting of the numerical indices of the topmost and
          bottommost body items visible in the tablelist window, i.e., of
          the numerical equivalents of the <a href="#row_indices">row
          indices</a> <code><b>top</b></code> and <code><b>bottom</code>.</td>

        </tr>
      </table>
    </dd>

    <dd class="tm">In addition, Tablelist_tile defines the virtual event
    <code><b>&lt;&lt;TablelistThemeDefaultsChanged&gt;&gt;</b></code> and sends
    it (without any user data) <i>to the main window</i> (!) after invoking the







|
>









|
>







8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
          <td><code><b>&lt;&lt;TablelistXViewChanged&gt;&gt;</b></code></td>
          <td>Generated whenever the horizontal view in the tablelist widget's
          window changes (and the horizontal scrollbar, if any, is
          updated).</td>
          <td>A list consisting of the numerical indices of the leftmost and
          rightmost columns visible in the tablelist window, i.e., of the
          numerical equivalents of the <a href="#col_indices">column
          indices</a> <code><b>left</b></code> and
	  <code><b>right</b></code>.</td>
        </tr>

        <tr valign="top">
          <td><code><b>&lt;&lt;TablelistYViewChanged&gt;&gt;</b></code></td>
          <td>Generated whenever the vertical view in the tablelist widget's
          window changes (and the vertical scrollbar, if any, is updated).</td>
          <td>A list consisting of the numerical indices of the topmost and
          bottommost body items visible in the tablelist window, i.e., of
          the numerical equivalents of the <a href="#row_indices">row
          indices</a> <code><b>top</b></code> and
	  <code><b>bottom</b></code>.</td>
        </tr>
      </table>
    </dd>

    <dd class="tm">In addition, Tablelist_tile defines the virtual event
    <code><b>&lt;&lt;TablelistThemeDefaultsChanged&gt;&gt;</b></code> and sends
    it (without any user data) <i>to the main window</i> (!) after invoking the
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
            <li class="tm">If the optional argument was given as
            <code><b>-fully</b></code>, then the subcommand inserts all the
            body items under the corresponding parent nodes via
            <code><b><a href="#insertchildren">insertchild</a></b></code>, and
            after that it collapses all rows of the tablelist by invoking&nbsp;
            <code><b><a href="#collapseall">collapseall</a>
            -fully</b></code>.</li>
          <ul>
        </dd>

        <dd class="tm"><b>REMARK 1:</b>&nbsp; Invoking this subcommand with the
        default <code><b>-partly</b></code> option is the recommended way to
        use it, being that it inserts the top-level items only, which makes the
        widget much more responsive than one having all its items effectively
        inserted.</dd>







|







10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
            <li class="tm">If the optional argument was given as
            <code><b>-fully</b></code>, then the subcommand inserts all the
            body items under the corresponding parent nodes via
            <code><b><a href="#insertchildren">insertchild</a></b></code>, and
            after that it collapses all rows of the tablelist by invoking&nbsp;
            <code><b><a href="#collapseall">collapseall</a>
            -fully</b></code>.</li>
          </ul>
        </dd>

        <dd class="tm"><b>REMARK 1:</b>&nbsp; Invoking this subcommand with the
        default <code><b>-partly</b></code> option is the recommended way to
        use it, being that it inserts the top-level items only, which makes the
        widget much more responsive than one having all its items effectively
        inserted.</dd>