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

I have a frame containing multiple widgets. The number of widgets can vary at runtime. I want this frame to be scrollable only if the number of widgets goes beyond a certain value, or alternatively, add a scrollbar if the size of the frame goes beyond the maxsixe of the parent. Is there a way of doing this? If I use the Scrolled method to create the Frame, and specify 'oe' for -scrollbars option, can I configure when the 'optional' takes effect?
  • Comment on How do I configure the optional property of a scrollbar?

Replies are listed 'Best First'.
Re: How do I configure the optional property of a scrollbar?
by zentara (Cardinal) on Jul 28, 2008 at 12:44 UTC
    Well you didn't show an example, but the scrollbar widget can be tricky. You can get the to the scrollbar subwidget and try to configure it, but you may run into glitches, because the 'osoe' is usually what people want, and if you want to fiddle with it, be prepared for automatic update problems.

    The Scrolled Pane widget, is almost always better to use than the Scrolled Frame, so switch to a Scrolled Pane and see if that works better for you. But here is an example of detecting Frame size (then you can try to configure the scrollbars manually), otherwise show us an example of what you are trying to accomplish.


    I'm not really a human, but I play one on earth Remember How Lucky You Are