Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Using Perl/Tk I've defined a horizontally Scrolled('Canvas', ...) whose -height I would like to change dynamically. I've tried:

1) configure(-height ...) on the scrolled widget,
2) configure(-height ...) on the 'canvas' subwidget,
3) re-packing the widget after configure,
4) re-packing the Frame that contains the widget.

Nothing seems to work: the widget remains at the originally-defined height, even though cget(-height) always returns the desired new value. I'm not a newcomer to Tk, but I've never run into a problem so intransigent. I must be overlooking something really stupid. Any ideas?

Replies are listed 'Best First'.
Resizing a Scrolled Canvas: Followup
by Anonymous Monk on Mar 22, 2001 at 08:23 UTC
    I'm the original poster. I found an obscure reference, after many Google probes, to a method called GeometryRequest. I don't know why the following is even necessary, but it works:
    $ScrolledCanvas->configure(-height => $Ht); $ScrolledCanvas->GeometryRequest($ScrolledCanvas->cget(-width), $Ht);

    Knowing only that it works leaves me a bit cold. It looks like brute force in the face of failed finesse, but if someone can explain why it's necessary, I'd be most grateful!

    Many thanks.