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
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
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.
On 04/09/2025 19:59, nemethi wrote:...and I've just tried dragging the full-sized sliders with button-1
Am 04.09.25 um 16:45 schrieb Alan Grunwald:I have tried exactly that - making the window small. For both scrollbars,
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.
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
On 04/09/2025 22:16, Alan Grunwald wrote:
On 04/09/2025 19:59, nemethi wrote:...and I've just tried dragging the full-sized sliders with button-1
Am 04.09.25 um 16:45 schrieb Alan Grunwald:I have tried exactly that - making the window small. For both scrollbars,
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.
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
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.)
On 04/09/2025 22:23, Alan Grunwald wrote:
On 04/09/2025 22:16, Alan Grunwald wrote:Aaargh, sorry - it's obviously too late for me to reply coherently.
On 04/09/2025 19:59, nemethi wrote:...and I've just tried dragging the full-sized sliders with button-1 down, and that works as expected too.
Am 04.09.25 um 16:45 schrieb Alan Grunwald:I have tried exactly that - making the window small. For both scrollbars, >>>
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.
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
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.)
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.
BTW, in tcl 8 scrollbars weren't bound to the mousewheel with the ttk widgets (might have been fixed in most recent tcl 8)
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:Aaargh, sorry - it's obviously too late for me to reply coherently.
On 04/09/2025 19:59, nemethi wrote:...and I've just tried dragging the full-sized sliders with button-1
Am 04.09.25 um 16:45 schrieb Alan Grunwald:I have tried exactly that - making the window small. For both
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.
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
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.)
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
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?
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
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.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,071 |
Nodes: | 10 (0 / 10) |
Uptime: | 98:55:26 |
Calls: | 13,756 |
Files: | 186,984 |
D/L today: |
39 files (10,464K bytes) |
Messages: | 2,426,439 |