Subj : frame.js scrollbars To : Nightfox From : echicken Date : Wed Nov 25 2015 10:56 pm > I was using LIGHTGRAY. I tried BG_LIGHTGRAY just now, and I think it > actually looks/behaves better with LIGHTGRAY. Only the BG_* values in sbbsdefs.js should be used for background colours; using the others may result in strange-looking things. LIGHTGRAY incidentally looks better as a background here because - since WHITE is your foreground - it's like not setting a background colour at all. The foreground and background colours are OR-ed together to make an attribute number. In this case you end up with WHITE|LIGHTGRAY, which is 15|7, which is 15, which is WHITE. (You should see the same result when using any other non-BG_* colour as your background, so long as WHITE is your foreground.) > The ANSI content is being loaded before the scrollbar & frame are opened for > the first time. Should it be loaded after? Not sure - I was just curious. How are you loading the ANSI stuff into the Frame - using Frame.load(), or some other way (Frame.putmsg(), etc.)? > Ah, that seems to help. So it seems that the documentation (comments) in > scrollbar.js are wrong - Not really. The example works, but there's a crucial difference between it and what you're doing. (Which isn't to say that your way is wrong.) > 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(). Frame.cycle() returns true if something changed, false otherwise. In my example, I'm only updating the ScrollBar if something changed in the Frame it's attached to. However changes to the ScrollBar's position won't be displayed until the Frame is cycled again. In my example, that next Frame.cycle() happens right away. In your code, there's presumably a blocking input prompt (console.getkey perhaps) in between. The best solution would be for me to just bring ScrollBar into frame.js, and tie it into the Frame.cycle() method. Then you would use those currently-placeholder properties of Frame to enable scrollbars, and the rest would work behind the scenes - no need to manage the scrollbars separately. --- echicken electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230 --- þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com .