22# Populates the content frame of the scrollutil::scrollableframe widget created
33# in the demo script SuScrollableFrmDemo2.tcl.
44#
5- # Copyright (c) 2019-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
5+ # Copyright (c) 2019-2021 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
66# ==============================================================================
77
88#
@@ -254,11 +254,10 @@ foreach colId [$tv cget -columns] {
254254# Set the scrollableframe's width, height, and yscrollincrement
255255#
256256wm withdraw .
257- update idletasks
258- set width [winfo reqwidth $cf ]
257+ $sf autosize w
259258set height [expr {[winfo reqheight $cf .l0] + [winfo pixels . 4p] + \
260259 [winfo reqheight $cf .sa1] + 2*[winfo pixels . 7p]}]
261- $sf configure -width $width - height $height \
260+ $sf configure -height $height \
262261 -yscrollincrement [expr {[winfo reqheight $lb ] / 10}]
263262
264263pack $sa -expand yes -fill both -padx 7p -pady 7p
@@ -362,33 +361,18 @@ proc configTablelist {} {
362361 switch -- $opt {
363362 -activestyle { set values {frame none underline} }
364363 -arrowstyle {
365- set values {flat5x3 flat5x4 flat6x4 flat7x4 flat7x5
366- flat7x7 flat8x4 flat8x5 flat9x5 flat9x6 flat11x6
367- flat15x8 flatAngle7x4 flatAngle7x5 flatAngle9x5
368- flatAngle9x6 flatAngle9x7 flatAngle10x6
369- flatAngle10x7 flatAngle11x6 flatAngle15x8 photo7x4
370- photo7x7 photo9x5 photo11x6 photo15x8 sunken8x7
371- sunken10x9 sunken12x11}
364+ set values $tablelist::arrowStyles ;# dirty, but safe
372365 }
373366 -incrarrowtype { set values {up down} }
374367 -labelrelief -
375368 -relief {
376369 set values {flat groove raised ridge solid sunken}
377370 }
378- -selectmode {
379- set values {single browse multiple extended}
380- }
371+ -selectmode { set values {single browse multiple extended} }
381372 -selecttype { set values {row cell} }
382373 -state { set values {disabled normal} }
383374 -treestyle {
384- set values {adwaita ambiance aqua arc baghira bicolor1
385- bicolor2 bicolor3 bicolor4 blueMenta classic1 classic2
386- classic3 classic4 dust dustSand gtk klearlooks mate
387- menta mint mint2 newWave oxygen1 oxygen2 phase plain1
388- plain2 plain3 plain4 plastik plastique radiance ubuntu
389- ubuntu2 ubuntu3 ubuntuMate vistaAero vistaClassic
390- win7Aero win7Classic win10 winnative winxpBlue
391- winxpOlive winxpSilver yuyo}
375+ set values $tablelist::treeStyles ;# dirty, but safe
392376 }
393377 }
394378
@@ -408,6 +392,7 @@ proc configTablelist {} {
408392 -autoscan -
409393 -customdragsource -
410394 -displayondemand -
395+ -editendonfocusout -
411396 -editselectedonly -
412397 -exportselection -
413398 -forceeditendcommand -
@@ -487,11 +472,10 @@ proc configTablelist {} {
487472 #
488473 # Set the scrollableframe's width, height, and yscrollincrement
489474 #
490- update idletasks
475+ $sf autosize
491476 set rowHeight [expr {[winfo reqheight $cf ] / $row }]
492477 set height [expr {10*$rowHeight + [winfo pixels .top 4p]}]
493- $sf configure -width [winfo reqwidth $cf ] -height $height \
494- -yscrollincrement $rowHeight
478+ $sf configure -height $height -yscrollincrement $rowHeight
495479
496480 #
497481 # Create a ttk::button widget outside the scrollarea
0 commit comments