• GUI help wanted please

    From Alan Grunwald@[email protected] to comp.lang.tcl on Thu Sep 4 15:45:27 2025
    From Newsgroup: comp.lang.tcl

    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty ttk::frame widget):

    set m_tbl [tablelist::tablelist $frm.tbl]

    .
    . Populate the tablelist including setting
    . its -columns
    .
    set vsb [ttk::scrollbar $frm.vsb \
    -orient vertical \
    -command [list $m_tbl yview]]
    set hsb [ttk::scrollbar $frm.hsb \
    -orient horizontal \
    -command [list $m_tbl xview]]

    $m_tbl configure \
    -yscrollcommand [list $vsb set] \
    -xscrollcommand [list $hsb set]

    grid $m_tbl -row 0 -column 0 -sticky nsew

    grid $vsb -row 0 -column 1 -sticky nsew
    grid $hsb -row 1 -column 0 -sticky nsew

    grid columnconfigure $frm 0 -weight 1
    grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars respond properly if I point to them and move the mousewheel (I'm running on
    Linux), but I can't move the thumbs by clicking with the mouse.

    I've clearly done something silly when setting everything up, but I'm
    hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Thu Sep 4 18:24:31 2025
    From Newsgroup: comp.lang.tcl

    Am 04.09.2025 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty ttk::frame widget):

            set m_tbl [tablelist::tablelist $frm.tbl]

                    .
                    . Populate the tablelist including setting
                    . its -columns
                    .
            set vsb [ttk::scrollbar $frm.vsb                       \
                     -orient vertical                          \
                     -command [list $m_tbl yview]]
            set hsb [ttk::scrollbar $frm.hsb                       \
                     -orient horizontal                        \
                     -command [list $m_tbl xview]]

            $m_tbl configure                                       \
                -yscrollcommand [list $vsb set]                    \
                -xscrollcommand [list $hsb set]

            grid $m_tbl -row 0 -column 0 -sticky nsew

            grid $vsb -row 0 -column 1 -sticky nsew
            grid $hsb -row 1 -column 0 -sticky nsew

            grid columnconfigure $frm 0 -weight 1
            grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars respond properly if I point to them and move the mousewheel (I'm running on
    Linux), but I can't move the thumbs by clicking with the mouse.

    I've clearly done something silly when setting everything up, but I'm
    hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    I have no answer tto your question, all looks ok.
    But Tablelist works nicely with scrollutil. It manages the scrollbars
    and displays them only when necessary.
    You may also always show the title row and exclude the title row from
    the scrolling.
    See scrollutil examples for this.
    The best point is bidirectional two-finger scroll on the mouse pad.

    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Thu Sep 4 20:59:17 2025
    From Newsgroup: comp.lang.tcl

    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty ttk::frame widget):

            set m_tbl [tablelist::tablelist $frm.tbl]

                    .
                    . Populate the tablelist including setting
                    . its -columns
                    .
            set vsb [ttk::scrollbar $frm.vsb                       \
                     -orient vertical                          \
                     -command [list $m_tbl yview]]
            set hsb [ttk::scrollbar $frm.hsb                       \
                     -orient horizontal                        \
                     -command [list $m_tbl xview]]

            $m_tbl configure                                       \
                -yscrollcommand [list $vsb set]                    \
                -xscrollcommand [list $hsb set]

            grid $m_tbl -row 0 -column 0 -sticky nsew

            grid $vsb -row 0 -column 1 -sticky nsew
            grid $hsb -row 1 -column 0 -sticky nsew

            grid columnconfigure $frm 0 -weight 1
            grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars respond properly if I point to them and move the mousewheel (I'm running on
    Linux), but I can't move the thumbs by clicking with the mouse.

    I've clearly done something silly when setting everything up, but I'm
    hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy the
    whole of their troughs". This can only be the case if the window is big enough to display all the rows and columns without the need for
    scrolling. Then it is quite normal that you can't move the thumbs.

    OTOH, you also wrote that the scrollbars "respond properly" to
    mousewheel events. What did you mean by this? The expected behavior is
    that the thumbs cannot be moved with the aid of the mousewheel either.

    After making the window sufficiently small, you should be able to move
    the thumbs both with mouse button 1 and by moving the wheel.
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Thu Sep 4 22:16:12 2025
    From Newsgroup: comp.lang.tcl

    On 04/09/2025 19:59, nemethi wrote:
    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-like
    capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty
    ttk::frame widget):

             set m_tbl [tablelist::tablelist $frm.tbl]

                     .
                     . Populate the tablelist including setting >>                  . its -columns
                     .
             set vsb [ttk::scrollbar $frm.vsb                       \
                      -orient vertical                          \
                      -command [list $m_tbl yview]]
             set hsb [ttk::scrollbar $frm.hsb                       \
                      -orient horizontal                        \
                      -command [list $m_tbl xview]]

             $m_tbl configure                                       \
                 -yscrollcommand [list $vsb set]                    \
                 -xscrollcommand [list $hsb set]

             grid $m_tbl -row 0 -column 0 -sticky nsew

             grid $vsb -row 0 -column 1 -sticky nsew
             grid $hsb -row 1 -column 0 -sticky nsew

             grid columnconfigure $frm 0 -weight 1
             grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars
    respond properly if I point to them and move the mousewheel (I'm
    running on Linux), but I can't move the thumbs by clicking with the
    mouse.

    I've clearly done something silly when setting everything up, but I'm
    hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy the
    whole of their troughs".  This can only be the case if the window is big enough to display all the rows and columns without the need for
    scrolling.  Then it is quite normal that you can't move the thumbs.

    OTOH, you also wrote that the scrollbars "respond properly" to
    mousewheel events.  What did you mean by this?  The expected behavior is that the thumbs cannot be moved with the aid of the mousewheel either.

    After making the window sufficiently small, you should be able to move
    the thumbs both with mouse button 1 and by moving the wheel.

    I have tried exactly that - making the window small. For both scrollbars,

    o the slider always occupies the whole of the trough;
    o turning the mousewheel moves the tablelist left/down
    or right/up
    o clicking the arrows moves the tablelist as expected (I
    hadn't tried this before)

    For what it's worth I'm using homebrew Tcl 9.0.2 and Tk 9.0.2 and Tablelist_Tile 7.7.

    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Thu Sep 4 22:23:38 2025
    From Newsgroup: comp.lang.tcl

    On 04/09/2025 22:16, Alan Grunwald wrote:
    On 04/09/2025 19:59, nemethi wrote:
    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-like
    capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty
    ttk::frame widget):

             set m_tbl [tablelist::tablelist $frm.tbl]

                     .
                     . Populate the tablelist including setting >>>                  . its -columns
                     .
             set vsb [ttk::scrollbar $frm.vsb                       \
                      -orient vertical                          \
                      -command [list $m_tbl yview]]
             set hsb [ttk::scrollbar $frm.hsb                       \
                      -orient horizontal                        \
                      -command [list $m_tbl xview]]

             $m_tbl configure                                       \
                 -yscrollcommand [list $vsb set]                    \
                 -xscrollcommand [list $hsb set]

             grid $m_tbl -row 0 -column 0 -sticky nsew

             grid $vsb -row 0 -column 1 -sticky nsew
             grid $hsb -row 1 -column 0 -sticky nsew

             grid columnconfigure $frm 0 -weight 1
             grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars
    respond properly if I point to them and move the mousewheel (I'm
    running on Linux), but I can't move the thumbs by clicking with the
    mouse.

    I've clearly done something silly when setting everything up, but I'm
    hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy the
    whole of their troughs".  This can only be the case if the window is
    big enough to display all the rows and columns without the need for
    scrolling.  Then it is quite normal that you can't move the thumbs.

    OTOH, you also wrote that the scrollbars "respond properly" to
    mousewheel events.  What did you mean by this?  The expected behavior
    is that the thumbs cannot be moved with the aid of the mousewheel either.

    After making the window sufficiently small, you should be able to move
    the thumbs both with mouse button 1 and by moving the wheel.

    I have tried exactly that - making the window small. For both scrollbars,

        o   the slider always occupies the whole of the trough;
        o   turning the mousewheel moves the tablelist left/down
          or right/up
        o   clicking the arrows moves the tablelist as expected (I
          hadn't tried this before)

    For what it's worth I'm using homebrew Tcl 9.0.2 and Tk 9.0.2 and Tablelist_Tile 7.7.

    Alan
    ...and I've just tried dragging the full-sized sliders with button-1
    down, and that works as expected too.

    It's just the size of the sliders that's wrong.

    (I do get a load of errors from the Tk tests, but I've always got them
    and taken no notice. Also, I've made scrollable widgets this way in
    loads of other places in this and other scripts and as far as I can tell
    they all work as expected.)

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Thu Sep 4 22:29:57 2025
    From Newsgroup: comp.lang.tcl

    On 04/09/2025 22:23, Alan Grunwald wrote:
    On 04/09/2025 22:16, Alan Grunwald wrote:
    On 04/09/2025 19:59, nemethi wrote:
    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now
    using a tablelist (actually tablelist_tile) without its treeview-
    like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an
    empty ttk::frame widget):

             set m_tbl [tablelist::tablelist $frm.tbl]

                     .
                     . Populate the tablelist including setting
                     . its -columns
                     .
             set vsb [ttk::scrollbar $frm.vsb                       \
                      -orient vertical                          \
                      -command [list $m_tbl yview]]
             set hsb [ttk::scrollbar $frm.hsb                       \
                      -orient horizontal                        \
                      -command [list $m_tbl xview]]

             $m_tbl configure                                       \
                 -yscrollcommand [list $vsb set]                    \
                 -xscrollcommand [list $hsb set]

             grid $m_tbl -row 0 -column 0 -sticky nsew

             grid $vsb -row 0 -column 1 -sticky nsew
             grid $hsb -row 1 -column 0 -sticky nsew

             grid columnconfigure $frm 0 -weight 1
             grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their
    troughs (I hope I've got the terms right :-) ). Both scrollbars
    respond properly if I point to them and move the mousewheel (I'm
    running on Linux), but I can't move the thumbs by clicking with the
    mouse.

    I've clearly done something silly when setting everything up, but
    I'm hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy
    the whole of their troughs".  This can only be the case if the window
    is big enough to display all the rows and columns without the need
    for scrolling.  Then it is quite normal that you can't move the thumbs. >>>
    OTOH, you also wrote that the scrollbars "respond properly" to
    mousewheel events.  What did you mean by this?  The expected behavior >>> is that the thumbs cannot be moved with the aid of the mousewheel
    either.

    After making the window sufficiently small, you should be able to
    move the thumbs both with mouse button 1 and by moving the wheel.

    I have tried exactly that - making the window small. For both scrollbars,

         o   the slider always occupies the whole of the trough;
         o   turning the mousewheel moves the tablelist left/down
           or right/up
         o   clicking the arrows moves the tablelist as expected (I
           hadn't tried this before)

    For what it's worth I'm using homebrew Tcl 9.0.2 and Tk 9.0.2 and
    Tablelist_Tile 7.7.

    Alan
    ...and I've just tried dragging the full-sized sliders with button-1
    down, and that works as expected too.

    It's just the size of the sliders that's wrong.

    (I do get a load of errors from the Tk tests, but I've always got them
    and taken no notice. Also, I've made scrollable widgets this way in
    loads of other places in this and other scripts and as far as I can tell they all work as expected.)

    Aaargh, sorry - it's obviously too late for me to reply coherently.

    When I wrote above about scrolling with the mousewheel, I meant when
    pointing to the scrollbars. When pointing to the tablelist, the
    mousewheel works as expected. (In general, certainly with my test data,
    the window is tall enough to show all the rows, but too narrow to
    display all the columns, so I'm mainly interested in scrolling left and
    right, while pointing to the horizontal scrollbar.)

    That's it. I hope I'll be more competent tomorrow.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From et99@[email protected] to comp.lang.tcl on Thu Sep 4 15:28:21 2025
    From Newsgroup: comp.lang.tcl

    On 9/4/2025 2:29 PM, Alan Grunwald wrote:
    On 04/09/2025 22:23, Alan Grunwald wrote:
    On 04/09/2025 22:16, Alan Grunwald wrote:
    On 04/09/2025 19:59, nemethi wrote:
    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am now using a tablelist (actually tablelist_tile) without its treeview- like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an empty ttk::frame widget):

             set m_tbl [tablelist::tablelist $frm.tbl]

                     .
                     . Populate the tablelist including setting
                     . its -columns
                     .
             set vsb [ttk::scrollbar $frm.vsb                       \
                      -orient vertical                          \
                      -command [list $m_tbl yview]]
             set hsb [ttk::scrollbar $frm.hsb                       \
                      -orient horizontal                        \
                      -command [list $m_tbl xview]]

             $m_tbl configure                                       \
                 -yscrollcommand [list $vsb set]                    \
                 -xscrollcommand [list $hsb set]

             grid $m_tbl -row 0 -column 0 -sticky nsew

             grid $vsb -row 0 -column 1 -sticky nsew
             grid $hsb -row 1 -column 0 -sticky nsew

             grid columnconfigure $frm 0 -weight 1
             grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of their troughs (I hope I've got the terms right :-) ). Both scrollbars respond properly if I point to them and move the mousewheel (I'm running on Linux), but I can't move the thumbs by clicking with the mouse.

    I've clearly done something silly when setting everything up, but I'm hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy the whole of their troughs".  This can only be the case if the window is big enough to display all the rows and columns without the need for scrolling.  Then it is quite normal that you can't move the thumbs.

    OTOH, you also wrote that the scrollbars "respond properly" to mousewheel events.  What did you mean by this?  The expected behavior is that the thumbs cannot be moved with the aid of the mousewheel either.

    After making the window sufficiently small, you should be able to move the thumbs both with mouse button 1 and by moving the wheel.

    I have tried exactly that - making the window small. For both scrollbars, >>>
         o   the slider always occupies the whole of the trough;
         o   turning the mousewheel moves the tablelist left/down
           or right/up
         o   clicking the arrows moves the tablelist as expected (I
           hadn't tried this before)

    For what it's worth I'm using homebrew Tcl 9.0.2 and Tk 9.0.2 and Tablelist_Tile 7.7.

    Alan
    ...and I've just tried dragging the full-sized sliders with button-1 down, and that works as expected too.

    It's just the size of the sliders that's wrong.

    (I do get a load of errors from the Tk tests, but I've always got them and taken no notice. Also, I've made scrollable widgets this way in loads of other places in this and other scripts and as far as I can tell they all work as expected.)

    Aaargh, sorry - it's obviously too late for me to reply coherently.

    When I wrote above about scrolling with the mousewheel, I meant when pointing to the scrollbars. When pointing to the tablelist, the mousewheel works as expected. (In general, certainly with my test data, the window is tall enough to show all the rows, but too narrow to display all the columns, so I'm mainly interested in scrolling left and right, while pointing to the horizontal scrollbar.)

    That's it. I hope I'll be more competent tomorrow.



    Below works for me, on windows and tcl 9.1a0, to see the scrollbars, the . window had to be small enough with enough data. I added the startup code in the wiki on tablelist to fill in some rows.

    BTW, in tcl 8 scrollbars weren't bound to the mousewheel with the ttk widgets (might have been fixed in most recent tcl 8)




    console show
    package require tablelist
    wm geom . 185x261+128+128
    set frm [ttk::frame .frm]
    set m_tbl [tablelist::tablelist $frm.tbl -columns {0 "First Column" 0 "Another column"} -stretch all -background white]
    pack $frm -fill both -expand 1 -side top
    foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
    $m_tbl insert end [list "another row $row" "bla bla $row"]
    }
    set vsb [ttk::scrollbar $frm.vsb \
    -orient vertical \
    -command [list $m_tbl yview]]
    set hsb [ttk::scrollbar $frm.hsb \
    -orient horizontal \
    -command [list $m_tbl xview]]
    $m_tbl configure \
    -yscrollcommand [list $vsb set] \
    -xscrollcommand [list $hsb set]
    grid $m_tbl -row 0 -column 0 -sticky nsew
    grid $vsb -row 0 -column 1 -sticky nsew
    grid $hsb -row 1 -column 0 -sticky nsew
    grid columnconfigure $frm 0 -weight 1
    grid rowconfigure $frm 0 -weight 1


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Fri Sep 5 10:56:08 2025
    From Newsgroup: comp.lang.tcl

    Am 05.09.25 um 00:28 schrieb et99:

    BTW, in tcl 8 scrollbars weren't bound to the mousewheel with the ttk widgets (might have been fixed in most recent tcl 8)

    The <MouseWheel> event bindings support for ttk::scrollbar widgets was introduced in Tk 8.6.11. And since Tk 9.0 <Shift-MouseWheel> events
    sent to (ttk:)scrollbar widgets are handled in the same way as the <MouseWheel> events.
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Fri Sep 5 11:07:39 2025
    From Newsgroup: comp.lang.tcl

    On 04/09/2025 23:28, et99 wrote:
    On 9/4/2025 2:29 PM, Alan Grunwald wrote:
    On 04/09/2025 22:23, Alan Grunwald wrote:
    On 04/09/2025 22:16, Alan Grunwald wrote:
    On 04/09/2025 19:59, nemethi wrote:
    Am 04.09.25 um 16:45 schrieb Alan Grunwald:
    Hi, following my similarly-named message of a few days ago, I am
    now using a tablelist (actually tablelist_tile) without its
    treeview- like capabilities.

    It's all working quite nicely with one notable exception:

    I create a scrollable tablelist as below (frm is the name of an
    empty ttk::frame widget):

             set m_tbl [tablelist::tablelist $frm.tbl]

                     .
                     . Populate the tablelist including setting
                     . its -columns
                     .
             set vsb [ttk::scrollbar $frm.vsb                       \
                      -orient vertical                          \
                      -command [list $m_tbl yview]]
             set hsb [ttk::scrollbar $frm.hsb                       \
                      -orient horizontal                        \
                      -command [list $m_tbl xview]]

             $m_tbl configure                                       \
                 -yscrollcommand [list $vsb set]                    \
                 -xscrollcommand [list $hsb set]

             grid $m_tbl -row 0 -column 0 -sticky nsew

             grid $vsb -row 0 -column 1 -sticky nsew
             grid $hsb -row 1 -column 0 -sticky nsew

             grid columnconfigure $frm 0 -weight 1
             grid rowconfigure $frm 0 -weight 1

    When the frame is displayed, their thumbs occupy the whole of
    their troughs (I hope I've got the terms right :-) ). Both
    scrollbars respond properly if I point to them and move the
    mousewheel (I'm running on Linux), but I can't move the thumbs by >>>>>> clicking with the mouse.

    I've clearly done something silly when setting everything up, but >>>>>> I'm hanged if I can think what. Can anyone point it out to me?



    Many thanks,
    Alan

    You wrote that the thumbs (aka sliders) of both scrollbars "occupy
    the whole of their troughs".  This can only be the case if the
    window is big enough to display all the rows and columns without
    the need for scrolling.  Then it is quite normal that you can't
    move the thumbs.

    OTOH, you also wrote that the scrollbars "respond properly" to
    mousewheel events.  What did you mean by this?  The expected
    behavior is that the thumbs cannot be moved with the aid of the
    mousewheel either.

    After making the window sufficiently small, you should be able to
    move the thumbs both with mouse button 1 and by moving the wheel.

    I have tried exactly that - making the window small. For both
    scrollbars,

         o   the slider always occupies the whole of the trough;
         o   turning the mousewheel moves the tablelist left/down
           or right/up
         o   clicking the arrows moves the tablelist as expected (I
           hadn't tried this before)

    For what it's worth I'm using homebrew Tcl 9.0.2 and Tk 9.0.2 and
    Tablelist_Tile 7.7.

    Alan
    ...and I've just tried dragging the full-sized sliders with button-1
    down, and that works as expected too.

    It's just the size of the sliders that's wrong.

    (I do get a load of errors from the Tk tests, but I've always got
    them and taken no notice. Also, I've made scrollable widgets this way
    in loads of other places in this and other scripts and as far as I
    can tell they all work as expected.)

    Aaargh, sorry - it's obviously too late for me to reply coherently.

    When I wrote above about scrolling with the mousewheel, I meant when
    pointing to the scrollbars. When pointing to the tablelist, the
    mousewheel works as expected. (In general, certainly with my test
    data, the window is tall enough to show all the rows, but too narrow
    to display all the columns, so I'm mainly interested in scrolling left
    and right, while pointing to the horizontal scrollbar.)

    That's it. I hope I'll be more competent tomorrow.



    Below works for me, on windows and tcl 9.1a0, to see the scrollbars,
    the . window had to be small enough with enough data. I added the
    startup code in the wiki on tablelist to fill in some rows.

    BTW, in tcl 8 scrollbars weren't bound to the mousewheel with the ttk widgets (might have been fixed in most recent tcl 8)




        console show
        package require tablelist
        wm geom . 185x261+128+128
        set frm [ttk::frame .frm]
        set m_tbl [tablelist::tablelist $frm.tbl -columns {0 "First Column" 0 "Another column"} -stretch all -background white]
        pack $frm  -fill both -expand 1 -side top
        foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
            $m_tbl insert end [list "another row $row" "bla bla $row"]
        }
        set vsb [ttk::scrollbar $frm.vsb                  \
                -orient vertical                          \
                -command [list $m_tbl yview]]
        set hsb [ttk::scrollbar $frm.hsb                  \
                -orient horizontal                        \
                -command [list $m_tbl xview]]
        $m_tbl configure                                  \
                -yscrollcommand [list $vsb set]           \
                -xscrollcommand [list $hsb set]
        grid $m_tbl -row 0 -column 0 -sticky nsew
        grid $vsb -row 0 -column 1 -sticky nsew
        grid $hsb -row 1 -column 0 -sticky nsew
        grid columnconfigure $frm 0 -weight 1
        grid rowconfigure $frm 0 -weight 1



    The only difference I can see between your code and mine is that you
    include -strech all in the tablelist configuration. I tried adding that
    (which I probably should have had all along) and it made no difference.

    I've achieved my objective - to get a couple of other pairs of eyes to
    look over my code and check for obvious errors. It seems I haven't made
    any mistakes, so I'm inclined to write this off as "Weird, one of those things".

    Just in case, I include the code I use to populate the tablelist; I
    can't imagine that I've done anything to break the algorithm used by ttk::scrollbar to calculate the slider width in the getChangedRows
    method of my tame database object m_db, and it will bloat this thread to
    far too huge a size if I share any more code. Thanks for the suggestions
    and for looking over my code.

    set first true
    set m_changes [$m_db getChangedRows $m_tblName]
    foreach chg $m_changes {
    if {$first} {
    set cols [linsert [dict keys $chg] 0 Retain]
    $m_tbl configure -columns [concat {*}[lmap col $cols {
    list 0 $col
    }]]
    set colNo 0
    foreach {junk col junk} [$m_tbl cget -columns] {
    $m_tbl columnconfigure $colNo \
    -name [string tolower \
    [string map {" " ""} $col]]
    incr colNo
    }

    $m_tbl columnconfigure retain -formatcommand \
    [list [self object] formatRetain]
    set first false
    }

    $m_tbl insert end [linsert [dict values $chg] 0 1]
    $m_tbl cellconfigure end,retain \
    -image [dict get $m_images 1]
    }

    The formatRetain method returns an empty string as I rely on the images
    to indicate whether or not to retain that row.

    Thanks again,
    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Fri Sep 5 15:45:35 2025
    From Newsgroup: comp.lang.tcl

    Am 05.09.25 um 12:07 schrieb Alan Grunwald:

    The only difference I can see between your code and mine is that you
    include -strech all in the tablelist configuration. I tried adding that (which I probably should have had all along) and it made no difference.

    I've achieved my objective - to get a couple of other pairs of eyes to
    look over my code and check for obvious errors. It seems I haven't made
    any mistakes, so I'm inclined to write this off as "Weird, one of those things".

    Just in case, I include the code I use to populate the tablelist; I
    can't imagine that I've done anything to break the algorithm used by ttk::scrollbar to calculate the slider width in the getChangedRows
    method of my tame database object m_db, and it will bloat this thread to
    far too huge a size if I share any more code. Thanks for the suggestions
    and for looking over my code.

        set first true
        set m_changes [$m_db getChangedRows $m_tblName]
        foreach chg $m_changes {
            if {$first} {
            set cols [linsert [dict keys $chg] 0 Retain]
            $m_tbl configure -columns [concat {*}[lmap col $cols {
                list 0 $col
            }]]
            set colNo 0
            foreach {junk col junk} [$m_tbl cget -columns] {
                $m_tbl columnconfigure $colNo                      \
                -name [string tolower                          \
                        [string map {" " ""} $col]]
                incr colNo
            }

            $m_tbl columnconfigure retain -formatcommand           \
                [list [self object] formatRetain]
            set first false
            }

            $m_tbl insert end [linsert [dict values $chg] 0 1]
            $m_tbl cellconfigure end,retain                            \
            -image [dict get $m_images 1]
        }

    The formatRetain method returns an empty string as I rely on the images
    to indicate whether or not to retain that row.

    Thanks again,
    Alan

    For me the only significant difference between this code and the example posted by et99 is that you are configuring the -columns option just
    before inserting the first change, while in et99's script the columns
    are set at creation time. In order to see whether this might have any
    impact on the look and behavior of the scrollbars, I modified the
    example posted by et99 as follows:

    package require tablelist_tile
    wm geom . 185x261+128+128
    set frm [ttk::frame .frm]
    pack $frm -fill both -expand 1 -side top

    set m_tbl [tablelist::tablelist $frm.tbl]
    set first true
    foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
    if {$first} {
    $m_tbl configure -columns {0 "First Column" 0 "Another column"}
    set first false
    }
    $m_tbl insert end [list "another row $row" "bla bla $row"]
    }

    set vsb [ttk::scrollbar $frm.vsb \
    -orient vertical \
    -command [list $m_tbl yview]]
    set hsb [ttk::scrollbar $frm.hsb \
    -orient horizontal \
    -command [list $m_tbl xview]]
    $m_tbl configure \
    -yscrollcommand [list $vsb set] \
    -xscrollcommand [list $hsb set]
    grid $m_tbl -row 0 -column 0 -sticky nsew
    grid $vsb -row 0 -column 1 -sticky nsew
    grid $hsb -row 1 -column 0 -sticky nsew
    grid columnconfigure $frm 0 -weight 1
    grid rowconfigure $frm 0 -weight 1

    As expected, the thumbs of both scrollbars do *not* fill the troughs and
    can be moved with both mouse button 1 and the mouse wheel.

    Could you please run this script yourself and report back the result?

    Are you using any third-party theme?
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Fri Sep 5 15:55:28 2025
    From Newsgroup: comp.lang.tcl

    On 05/09/2025 14:45, nemethi wrote:
    Am 05.09.25 um 12:07 schrieb Alan Grunwald:

    The only difference I can see between your code and mine is that you
    include -strech all in the tablelist configuration. I tried adding
    that (which I probably should have had all along) and it made no
    difference.

    I've achieved my objective - to get a couple of other pairs of eyes to
    look over my code and check for obvious errors. It seems I haven't
    made any mistakes, so I'm inclined to write this off as "Weird, one of
    those things".

    Just in case, I include the code I use to populate the tablelist; I
    can't imagine that I've done anything to break the algorithm used by
    ttk::scrollbar to calculate the slider width in the getChangedRows
    method of my tame database object m_db, and it will bloat this thread
    to far too huge a size if I share any more code. Thanks for the
    suggestions and for looking over my code.

         set first true
         set m_changes [$m_db getChangedRows $m_tblName]
         foreach chg $m_changes {
             if {$first} {
             set cols [linsert [dict keys $chg] 0 Retain]
             $m_tbl configure -columns [concat {*}[lmap col $cols {
                 list 0 $col
             }]]
             set colNo 0
             foreach {junk col junk} [$m_tbl cget -columns] {
                 $m_tbl columnconfigure $colNo                      \
                 -name [string tolower                          \
                         [string map {" " ""} $col]]
                 incr colNo
             }

             $m_tbl columnconfigure retain -formatcommand           \
                 [list [self object] formatRetain]
             set first false
             }

             $m_tbl insert end [linsert [dict values $chg] 0 1]
             $m_tbl cellconfigure end,retain                            \
             -image [dict get $m_images 1]
         }

    The formatRetain method returns an empty string as I rely on the
    images to indicate whether or not to retain that row.

    Thanks again,
    Alan

    For me the only significant difference between this code and the example posted by et99 is that you are configuring the -columns option just
    before inserting the first change, while in et99's script the columns
    are set at creation time.  In order to see whether this might have any impact on the look and behavior of the scrollbars, I modified the
    example posted by et99 as follows:

        package require tablelist_tile
        wm geom . 185x261+128+128
        set frm [ttk::frame .frm]
        pack $frm -fill both -expand 1 -side top

        set m_tbl [tablelist::tablelist $frm.tbl]
        set first true
        foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
            if {$first} {
                $m_tbl configure -columns {0 "First Column" 0 "Another
    column"}
                set first false
            }
            $m_tbl insert end [list "another row $row" "bla bla $row"]
        }

        set vsb [ttk::scrollbar $frm.vsb                  \
                -orient vertical                          \
                -command [list $m_tbl yview]]
        set hsb [ttk::scrollbar $frm.hsb                  \
                -orient horizontal                        \
                -command [list $m_tbl xview]]
        $m_tbl configure                                  \
                -yscrollcommand [list $vsb set]           \
                -xscrollcommand [list $hsb set]
        grid $m_tbl -row 0 -column 0 -sticky nsew
        grid $vsb -row 0 -column 1 -sticky nsew
        grid $hsb -row 1 -column 0 -sticky nsew
        grid columnconfigure $frm 0 -weight 1
        grid rowconfigure $frm 0 -weight 1

    As expected, the thumbs of both scrollbars do *not* fill the troughs and
    can be moved with both mouse button 1 and the mouse wheel.

    Could you please run this script yourself and report back the result?

    Are you using any third-party theme?


    When I run the script, it behaves as expected - the thumbs don't fill
    the troughs; they can be moved by turning the mousewheel over the
    scrollbars and by clicking on the part of the trough not covered by the thumbs.

    I'm not using any third-party theme. I've been using the default theme,
    but for what it's worth, I have just tried with alt, clam and classic
    and the scrollbars misbehave in the same way with all four themes.

    Two random points that may or may not be relevant:

    o I generally use tkcon; when I pasted your modified version of
    et99's script into a tkcon console I couldn't see the frame. I
    eventually saved the test script to a file and ran it via
    wish9.0 <filename>
    I have slightly shot myself in the foot with tkcon and can't swear
    to where I got my current version from.
    o I usually run my script under tclsh and sometimes introduce
    tkcon after it starts up. I've tried a couple of times starting
    with wish rather than tclsh and I've also tried when I'm sure I
    haven't pulled in the tkcon sources. Nothing seems to make any
    difference.


    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Fri Sep 5 16:01:09 2025
    From Newsgroup: comp.lang.tcl

    On 05/09/2025 15:55, Alan Grunwald wrote:
    On 05/09/2025 14:45, nemethi wrote:
    Am 05.09.25 um 12:07 schrieb Alan Grunwald:

    The only difference I can see between your code and mine is that you
    include -strech all in the tablelist configuration. I tried adding
    that (which I probably should have had all along) and it made no
    difference.

    I've achieved my objective - to get a couple of other pairs of eyes
    to look over my code and check for obvious errors. It seems I haven't
    made any mistakes, so I'm inclined to write this off as "Weird, one
    of those things".

    Just in case, I include the code I use to populate the tablelist; I
    can't imagine that I've done anything to break the algorithm used by
    ttk::scrollbar to calculate the slider width in the getChangedRows
    method of my tame database object m_db, and it will bloat this thread
    to far too huge a size if I share any more code. Thanks for the
    suggestions and for looking over my code.

         set first true
         set m_changes [$m_db getChangedRows $m_tblName]
         foreach chg $m_changes {
             if {$first} {
             set cols [linsert [dict keys $chg] 0 Retain]
             $m_tbl configure -columns [concat {*}[lmap col $cols {
                 list 0 $col
             }]]
             set colNo 0
             foreach {junk col junk} [$m_tbl cget -columns] {
                 $m_tbl columnconfigure $colNo                      \
                 -name [string tolower                          \
                         [string map {" " ""} $col]]
                 incr colNo
             }

             $m_tbl columnconfigure retain -formatcommand           \
                 [list [self object] formatRetain]
             set first false
             }

             $m_tbl insert end [linsert [dict values $chg] 0 1]
             $m_tbl cellconfigure end,retain                            \
             -image [dict get $m_images 1]
         }

    The formatRetain method returns an empty string as I rely on the
    images to indicate whether or not to retain that row.

    Thanks again,
    Alan

    For me the only significant difference between this code and the
    example posted by et99 is that you are configuring the -columns option
    just before inserting the first change, while in et99's script the
    columns are set at creation time.  In order to see whether this might
    have any impact on the look and behavior of the scrollbars, I modified
    the example posted by et99 as follows:

         package require tablelist_tile
         wm geom . 185x261+128+128
         set frm [ttk::frame .frm]
         pack $frm -fill both -expand 1 -side top

         set m_tbl [tablelist::tablelist $frm.tbl]
         set first true
         foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
             if {$first} {
                 $m_tbl configure -columns {0 "First Column" 0 "Another
    column"}
                 set first false
             }
             $m_tbl insert end [list "another row $row" "bla bla $row"] >>      }

         set vsb [ttk::scrollbar $frm.vsb                  \
                 -orient vertical                          \
                 -command [list $m_tbl yview]]
         set hsb [ttk::scrollbar $frm.hsb                  \
                 -orient horizontal                        \
                 -command [list $m_tbl xview]]
         $m_tbl configure                                  \
                 -yscrollcommand [list $vsb set]           \
                 -xscrollcommand [list $hsb set]
         grid $m_tbl -row 0 -column 0 -sticky nsew
         grid $vsb -row 0 -column 1 -sticky nsew
         grid $hsb -row 1 -column 0 -sticky nsew
         grid columnconfigure $frm 0 -weight 1
         grid rowconfigure $frm 0 -weight 1

    As expected, the thumbs of both scrollbars do *not* fill the troughs
    and can be moved with both mouse button 1 and the mouse wheel.

    Could you please run this script yourself and report back the result?

    Are you using any third-party theme?


    When I run the script, it behaves as expected - the thumbs don't fill
    the troughs; they can be moved by turning the mousewheel over the
    scrollbars and by clicking on the part of the trough not covered by the thumbs.

    I'm not using any third-party theme. I've been using the default theme,
    but for what it's worth, I have just tried with alt, clam and classic
    and the scrollbars misbehave in the same way with all four themes.

    Two random points that may or may not be relevant:

        o     I generally use tkcon; when I pasted your modified version of
          et99's script into a tkcon console I couldn't see the frame. I
          eventually saved the test script to a file and ran it via
                      wish9.0 <filename>
          I have slightly shot myself in the foot with tkcon and can't swear
          to where I got my current version from.
        o     I usually run my script under tclsh and sometimes introduce
          tkcon after it starts up. I've tried a couple of times starting
          with wish rather than tclsh and I've also tried when I'm sure I
          haven't pulled in the tkcon sources. Nothing seems to make any
          difference.


    Alan

    Sorry! (It seems it wasn't just the lateness of the hour :-(. )

    I've just checked again and it seems that I can't run my code without
    pulling in the tkcon sources. I'll put some effort into testing without
    them and report back.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Fri Sep 5 16:15:06 2025
    From Newsgroup: comp.lang.tcl

    On 05/09/2025 16:01, Alan Grunwald wrote:
    On 05/09/2025 15:55, Alan Grunwald wrote:
    On 05/09/2025 14:45, nemethi wrote:
    Am 05.09.25 um 12:07 schrieb Alan Grunwald:

    The only difference I can see between your code and mine is that you
    include -strech all in the tablelist configuration. I tried adding
    that (which I probably should have had all along) and it made no
    difference.

    I've achieved my objective - to get a couple of other pairs of eyes
    to look over my code and check for obvious errors. It seems I
    haven't made any mistakes, so I'm inclined to write this off as
    "Weird, one of those things".

    Just in case, I include the code I use to populate the tablelist; I
    can't imagine that I've done anything to break the algorithm used by
    ttk::scrollbar to calculate the slider width in the getChangedRows
    method of my tame database object m_db, and it will bloat this
    thread to far too huge a size if I share any more code. Thanks for
    the suggestions and for looking over my code.

         set first true
         set m_changes [$m_db getChangedRows $m_tblName]
         foreach chg $m_changes {
             if {$first} {
             set cols [linsert [dict keys $chg] 0 Retain]
             $m_tbl configure -columns [concat {*}[lmap col $cols { >>>>              list 0 $col
             }]]
             set colNo 0
             foreach {junk col junk} [$m_tbl cget -columns] {
                 $m_tbl columnconfigure $colNo                      \
                 -name [string tolower                          \
                         [string map {" " ""} $col]]
                 incr colNo
             }

             $m_tbl columnconfigure retain -formatcommand           \
                 [list [self object] formatRetain]
             set first false
             }

             $m_tbl insert end [linsert [dict values $chg] 0 1]
             $m_tbl cellconfigure end,retain                            \
             -image [dict get $m_images 1]
         }

    The formatRetain method returns an empty string as I rely on the
    images to indicate whether or not to retain that row.

    Thanks again,
    Alan

    For me the only significant difference between this code and the
    example posted by et99 is that you are configuring the -columns
    option just before inserting the first change, while in et99's script
    the columns are set at creation time.  In order to see whether this
    might have any impact on the look and behavior of the scrollbars, I
    modified the example posted by et99 as follows:

         package require tablelist_tile
         wm geom . 185x261+128+128
         set frm [ttk::frame .frm]
         pack $frm -fill both -expand 1 -side top

         set m_tbl [tablelist::tablelist $frm.tbl]
         set first true
         foreach row {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
             if {$first} {
                 $m_tbl configure -columns {0 "First Column" 0 "Another
    column"}
                 set first false
             }
             $m_tbl insert end [list "another row $row" "bla bla $row"] >>>      }

         set vsb [ttk::scrollbar $frm.vsb                  \
                 -orient vertical                          \
                 -command [list $m_tbl yview]]
         set hsb [ttk::scrollbar $frm.hsb                  \
                 -orient horizontal                        \
                 -command [list $m_tbl xview]]
         $m_tbl configure                                  \
                 -yscrollcommand [list $vsb set]           \
                 -xscrollcommand [list $hsb set]
         grid $m_tbl -row 0 -column 0 -sticky nsew
         grid $vsb -row 0 -column 1 -sticky nsew
         grid $hsb -row 1 -column 0 -sticky nsew
         grid columnconfigure $frm 0 -weight 1
         grid rowconfigure $frm 0 -weight 1

    As expected, the thumbs of both scrollbars do *not* fill the troughs
    and can be moved with both mouse button 1 and the mouse wheel.

    Could you please run this script yourself and report back the result?

    Are you using any third-party theme?


    When I run the script, it behaves as expected - the thumbs don't fill
    the troughs; they can be moved by turning the mousewheel over the
    scrollbars and by clicking on the part of the trough not covered by
    the thumbs.

    I'm not using any third-party theme. I've been using the default
    theme, but for what it's worth, I have just tried with alt, clam and
    classic and the scrollbars misbehave in the same way with all four
    themes.

    Two random points that may or may not be relevant:

         o     I generally use tkcon; when I pasted your modified version of
           et99's script into a tkcon console I couldn't see the frame. I >>        eventually saved the test script to a file and ran it via
                       wish9.0 <filename>
           I have slightly shot myself in the foot with tkcon and can't swear
           to where I got my current version from.
         o     I usually run my script under tclsh and sometimes introduce
           tkcon after it starts up. I've tried a couple of times starting >>        with wish rather than tclsh and I've also tried when I'm sure I >>        haven't pulled in the tkcon sources. Nothing seems to make any >>        difference.


    Alan

    Sorry! (It seems it wasn't just the lateness of the hour :-(. )

    I've just checked again and it seems that I can't run my code without pulling in the tkcon sources. I'll put some effort into testing without
    them and report back.

    It was less effort than I feared to change my management of the tkcon
    sources. I'm now very confident that the scrollbars misbehave even when
    the tkcon sources haven't been pulled in. (Next step is to identify
    where I got those sources from.)
    --- Synchronet 3.21a-Linux NewsLink 1.2