File: view2.rb

# view2.rb

Path: | curses/view2.rb
Last Update: | Tue Jun 18 16:29:07 AUS Eastern Standard Time 2002

### Required files

curses

### Methods

scroll_down scroll_up

### Public Instance methods

scroll_down()

[Source]

    # File curses/view2.rb, line 57
    def scroll_down
      if( $top + $screen.maxy < $data_lines.length )
        $screen.scrl(1)
        $top += 1
        str = $data_lines[$top + $screen.maxy - 1]
        if( str )
          $screen.setpos($screen.maxy - 1, 0)
          $screen.addstr(str)
        end
        return true
      else
        return false
      end
    end

scroll_up()

[Source]

    # File curses/view2.rb, line 42
    def scroll_up
      if( $top > 0 )
        $screen.scrl(-1)
        $top -= 1
        str = $data_lines[$top]
        if( str )
          $screen.setpos(0, 0)
          $screen.addstr(str)
        end
        return true
      else
        return false
      end
    end

[Validate]