scroll() appears to be misbehaving on OSX
- Posted by dukester Nov 15, 2009
- 1163 views
The following code:
--demo program 51 include std/graphics.e integer keystroke, current_position bk_color(15) text_color(0) clear_screen() position(5,1) puts(1, repeat('=', 80)) position(20,1) puts(1, repeat('=', 80)) position(11,25) puts(1, "╓────────────────────────────╖") position(12,25) puts(1, "║ Welcome To The SCROLL ZONE ║") position(13,25) puts(1, "╙────────────────────────────╜") position(22,1) puts(1, "Press 8 for up, 2 for down, or q to quit this program") keystroke = get_key() current_position = 11 while keystroke != 'q' do if keystroke = '8' and current_position > 6 then scroll(1,6,19) current_position = current_position - 1 end if if keystroke = '2' and current_position < 17 then scroll(-1,6,19) current_position = current_position + 1 end if keystroke = get_key() end while clear_screen()
works as expected in DOS, i.e., the text: "Welcome To The SCROLL ZONE" scroll up and down at the original column number - at least under DOSBOX on OSX it does.
This is not so in a native OSX terminal. The text is moved to column 1, and then scrolls up and down, leaving the original characters there. The only way to rid the screen of the original characters is to scroll over them. dukester