> I was using LIGHTGRAY. I tried BG_LIGHTGRAY just now, and I think it
> actuall
y 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 t
hings.
LIGHTGRAY incidentally looks better as a background here because - since W
HITE
is your foreground - it's like not setting a background colour at all. The
f
oreground 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 a
s your background, so long as WHITE is your foreground.)
> The ANSI content is be
ing 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 d
ifference 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_col
umns, console.screen_rows);
> }
> That seems to suggest that if the frame cycle su
cceeds, then cycle the
> scrollbar. But as you suggested, it seems to work bette
r 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 u
pdating the ScrollBar if something changed in the Frame it's
attached to. Howeve
r changes to the ScrollBar's position won't be displayed
until the Frame is cycle
d again. In my example, that next Frame.cycle()
happens right away. In your cod
e, 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-placeholde
r properties of Frame to enable scrollbars, and the rest
would work behind the sc
enes - no need to manage the scrollbars separately.
---
echicken
electronic chicke
n bbs - bbs.electronicchicken.com - 416-273-7230
---
■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com
|