laziness, impatience, and hubris | |
PerlMonks |
Re^3: Perl/Tk Scrolled issueby rcseege (Pilgrim) |
on Aug 20, 2006 at 19:38 UTC ( [id://568435]=note: print w/replies, xml ) | Need Help?? |
I can't reproduce the problem with the colors, but I can for height/width. It isn't so much a problem as a misunderstanding of the Scrolled composite. When you use it you are delegating responsibility for displaying the 'scrolled' subwidget to the Scrolled composite. Scrolled allows you to initialize the settings (height/width) of the enclosed subwidget up until all events have been processed by MainLoop the first time. So the following will work:Updated: caught and corrected a typo in the first example. Added the qw to the configure method params. But the next, will not:
This is because by the time the Button has been pressed, sizing control has been yielded to Scrolled. You can take it back using the packPropagate method. Notice how the first Change button makes the change, but then when the second Change button tries, it cannot. The size is being passed, it's just not having any visible effect.
Another way I have dealt with this in the past is to enclose the Scrolled widget within another Frame, but set it up to expand/shrink as the parent frame resizes. Then I size the Frame instead of the Scrolled widget. HTH, Rob
In Section
Seekers of Perl Wisdom
|
|