code: def draw(self, writer, idx, offset):
          
          # as our screen can be resized while we're mid-calculation,
          # our self.dirty flag can become re-toggled; because we are
          # not re-flowing our pagination, we must begin over again.
          while self.dirty:
              self.draw_heading(writer)
              self.dirty = self.STATE_CLEAN
              (idx, offset), data = self.page_data(idx, offset)
              for txt in self.page_view(data):
                  writer(txt)
          self.draw_status(writer, idx)
          flushout()
          return idx, offset
docs: Draw the current page view to ``writer``.
  
          :param writer: callable writes to output stream, receiving unicode.
          :type writer: callable
          :param idx: current page index.
          :type idx: int
          :param offset: scrolling region offset of current page.
          :type offset: int
          :returns: tuple of next (idx, offset).
          :rtype: (int, int)