Subj : frame.js scrollbars To : echicken From : Nightfox Date : Wed Nov 25 2015 03:44 pm Re: frame.js scrollbars By: echicken to Nightfox on Wed Nov 25 2015 15:32:39 >> - When first displaying the file, it looks like the scrollbar has >> "holes" in it. This is a screenshot I made as an example (using white >> as the scrollbar foreground and light grey as the scrollbar >> background): ec> Not sure. Are you setting the background colour to LIGHTGRAY or ec> BG_LIGHTGRAY? Is the ANSI content being loaded before or after the ec> scrollbar is opened / cycled for the first time? I was using LIGHTGRAY. I tried BG_LIGHTGRAY just now, and I think it actually looks/behaves better with LIGHTGRAY. The ANSI content is being loaded before the scrollbar & frame are opened for the first time. Should it be loaded after? >> - I have an input loop in my script that waits for a keypress and >> scrolls the Frame when the user presses the up or down arrow, PageUp, >> PageDown, Home, or End. The scrollbar refreshes when I scroll up & >> down one line (using the Frame's scroll() method), but after using the >> Frame's scrollTo() method (which I'm using for PageUp, PageDown, Home, >> and End), the scrollbar doesn't refresh until cycle() is called a 2nd >> time (which happens when I press PageUp, PageDown, Home, or End in my >> script). ec> The ScrollBar doesn't actually redraw itself when you call .cycle() on it; ec> it just updates its position info. The drawing takes place when .cycle() ec> is called on the parent Frame. You could try calling .cycle() on the ec> ScrollBar after you have called Frame.scrollTo() but prior to calling ec> Frame.cycle(). (That may or may not help, but it's worth a shot.) Ah, that seems to help. So it seems that the documentation (comments) in scrollbar.js are wrong - There's a section of the comments that has an example of how to use it, and it has this: if(f.cycle()) { s.cycle(); console.gotoxy(console.screen_columns, console.screen_rows); } That seems to suggest that if the frame cycle succeeds, then cycle the scrollbar. But as you suggested, it seems to work better when the scrollbar's cycle() is called before the frame's cycle(). Nightfox --- þ Synchronet þ Digital Distortion: digitaldistortionbbs.com .