|Syntactic Confectionery Delight|
Bug in Win32 Perl/Tk Scrolled ROText widget with optional scrollbarsby liverpole (Monsignor)
|on Oct 28, 2006 at 23:12 UTC||Need Help??|
liverpole has asked for the wisdom of the Perl Monks concerning the following question:
Greetings fellow monks,
A few days ago someone in the chatterbox gave a link to this site, which is a kind of word-association puzzle.
After trying it out, and getting hooked (it's addicting!), I decided to write a little Windows Perl/Tk GUI to help me
When I created a Scrolled "ROText" widget, I realized there was an apparent bug which I have seen recently in other Perl/TK applications:
The above line is supposed to create a Scrolled Read-only Text (ROText) widget, with a lilac background color (0xffdfff), and optional 'South' and 'East' scrollbars. When the widget is first filled with text, though, even if the "East" (right-side) scrollbar appears, the slider bar does not appear.
After resizing the whole GUI, however, the ROText window is resized, causing the scrollbar slider to appear as it should have done. Another way to make the slider "pop into view" is to click the left mouse inside the ROText window, and move the mouse outside of the window (still holding the button down).
I've done some searching, both inside and outside of Perlmonks, for anyone with a similar problem, but haven't found anything that seems to address the issue.
Has anyone else seen this bug?
I have found that I can get around the problem by doing a $t->see("1.0"), followed by a $t->update(), before trying to see the end of the text window.
Here is a stripped-down version of the entire program. To demonstrate the problem, type a valid address into the Entry widget marked "HTTP Address", and then type <Return>, or click the button marked "Load". To demonstrate the workaround, select the Checkbutton marked "Workaround" first; leave it unselected to see the bug (in Windows):
Can anyone tell me whether this is a known bug? And, is there a better workaround than the one I've implemented above? The bug also happens with a regular Scrolled "Text" window, but I'd be very interested if anyone knows what other conditions make it happen.
For the record, I am using ActiveState Perl, version 5.8.7, binary build 815 , built on November 2, 2005.
Update: Added <readmore> tags.