When trying to build a custom scrolledframe one generally resorts to the <Configure> event to catch the resizing of the scrolled frame [usually a frame inside a canvas] to keep scrollbars in sync. The problem with this approach is that, when the last slave is removed from inside the frame, the geometry managers leave the frame size as-is, and the scrolled frame ends scrolling an empty region.
This can be noted in this BWidget example:
==================================================
package require BWidget
set sw [ScrolledWindow .sw]
set sf [ScrollableFrame .sf]
$sw setwidget $sf
set f [$sf getframe]
pack $sw -expand 1 -fill both -padx 10 -pady 10
for {set i 0} {$i <= 20} {incr i} {
grid \
[label $f.la$i -text "Label a order $i"] \
[label $f.lb$i -text "Label b order $i"] \
[label $f.lc$i -text "Label c order $i"]
}
A way to note when the GM removes the last slave is to deliver a virtual event to the master.
This patch adds the virtual event, and is intended as a sketch of the final code (the name of the
virtual event, and whether to send additional details or not can be changed)
Forgot to mention, patch's code is copied almost literally from the GenerateModifiedEvent() function in generic/tkText.c
If it is the fact that a master gets empty that is important, or that it becomes
unmanaged?
If the latter, maybe the event should reside in the recently added
TkFreeGeometryMaster which gets called regardless what is causing it
to become unmanaged..
It is the master becoming empty, which otherwise passes no events (not even <Configure>), so Tcl-based gms like scrollableframe can't shrink accordingly. There are possibly other vevents that would make sense to generate to get rid of the reliance on <Configure> in so many apps.