Forth Lesson 14

From OLPC
Revision as of 20:13, 10 August 2007 by RafaelOrtiz (talk | contribs) (+cat)
Jump to navigation Jump to search

Some Cute Hacks

Small scrolling region

If you want to play around with graphics, it is nice to make the text scroller smaller so it doesn't get in the way of the graphics.

ok screen-ih iselect
ok 5 to #lines
ok screen-height  char-height 5 *  -  to window-top
ok iunselect

That makes the scroller 5 lines high and moves it to the bottom of the screen.

You could put that in a file on a USB key to run it automatically - /boot/olpc.fth .

The shortest way to say it would be:

ok screen-ih iselect  5 to #lines  316 to window-top  iunselect

316 is the hex number that results from the computation "screen-height char-height 5 * -". Obviously it is dependent on specifics of the OLPC machine and the number of lines in the scroller, but you get the idea.