RE: Scrollbar misbehaving w/ ROText ?
"Bill Mezian" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Dean, I just finished an application using Scrolled ROText as a message window that is updated as each step of the application is processed, and to display help files, etc., also on XP. I have noticed that the ROText window doesn't particularly want to allow scrolling up while the window is still filling, but I haven't noticed the behavior you're referring to. The differences I did notice are I am using word rather than character wrap, so you might try that change and see if it helps. Also, I am scrolling the window and updating it after inserting each line, except in the instance of displaying a help file, which eliminates the need to manually scroll down. All the best, Bill -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Dean Arnold Sent: Thursday, May 12, 2005 1:52 PM To: [email protected] Subject: Scrollbar misbehaving w/ ROText ? I have an app with a Scrolled ROText. The ROText is a Console type window for an IDE, so new lines are always being added at the bottom. It only has an vertical scrollbar (BTW, this is WinXP, pTK 804.027 + patches, AS 5.8.3). When the ROText starts filling up, and I scroll up to see whats happened, then attempt to scroll back down by clicking below the slider (or even dragging the slider directly), occasionally the slider (and text) goes in the wrong direction, or won't move at all. It only seems to happen when the slider is near the bottom, and a signifcant amount of text has been added. Is this a known problem, and, if so, is there a patch I've overlooked ? (I didn't get any google hits describing this specific behavior). Here's sample code that exihbits this behavior; you'll need to scroll to the bottom, then try dragging the slider up to scroll back, and/or try to click below the slider (it takes a few tries before it gets confused): use Tk; use Tk::ROText; use strict; my $page; my $mw = MainWindow->new; my $textfont = { -family => 'Courier', -size => 10, -weight => 'normal', -slant => 'roman' }; my $labelfont = { -family => 'Arial', -size => 10, -weight => 'bold', -slant => 'roman' }; $mw->fontCreate('_textfont', %$textfont); $mw->fontCreate('_labelfont', %$labelfont); $mw->DefineBitmap('bgstipple' => 8, 2, pack('b8' x 2, '1.1.1.1.', '.1.1.1.1')); $page = $mw->Scrolled('ROText', -scrollbars => 'e', -height => 15, -width => 40, -font => '_textfont', -wrap => 'char', -background => 'white', -selectbackground => 'blue' ) ->pack(-side => 'left', -expand => 0, -fill => 'both'); $page->tagConfigure('sel', -bgstipple => 'bgstipple'); $page->tagConfigure('errtext', -foreground => '#fff020000000', -font => '_labelfont'); $page->tagConfigure('infotext', -foreground => '#20000000fff0', -font => '_labelfont'); $page->tagConfigure('resulttext', -foreground => 'black', -font => '_textfont'); $page->tagConfigure('warntext', -foreground => 'gray30', -font => '_labelfont'); $page->tagConfigure('findtext', -background => 'green', -foreground => 'blue', -bgstipple => 'bgstipple'); # # extend the popup menu # my $qtpopup = $page->menu; # # borrow the edit and search menu callbacks for our edit menubar # Will this cause problems when we discard <base> window ? # my $qteditpopup = $qtpopup->entrycget('Edit', -menu); my $qtviewpopup = $qtpopup->entrycget('View', -menu); # # don't let them do dangerous stuff here... # $qtpopup->delete('File'); $qtpopup->delete('Search'); # # add a bunch of lines # $page->insert('end', "asdga qergw thwfr wwtrhefgghdfgj wetjdfgh eghgsdsgh\n") foreach (1..900); $mw->MainLoop; Also, I've noticed the problem described in http://groups-beta.google.com/group/comp.lang.perl.tk/browse_thread/thread/8 bb344e28db863fc/cc6ae8023688bd7e?q=scroll+slider+bug+group:comp.lang.perl.tk &rnum=1&hl=en#cc6ae8023688bd7e still seems to exist ? I have some popup windows with help text (using vertically scrolled ROTexts) that sometimes have embedded images, and the scrollbar size does change depending on the current location in the text. Is there a fix/workaround in 804.027 yet ? Thanks, Dean Arnold Presicient Corp. -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected] -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected]