frame_set_line Subroutine

private subroutine frame_set_line(this, row, text)

Set one line, truncated to the frame width in code points.

A row outside the frame is ignored rather than an error: a caller drawing a list longer than the terminal should not have to check every write.

Type Bound

frame_t

Arguments

Type IntentOptional Attributes Name
class(frame_t), intent(inout) :: this
integer(kind=default_int), intent(in) :: row

One-based row.

character(len=*), intent(in) :: text

Text for the row.


Calls

proc~~frame_set_line~~CallsGraph proc~frame_set_line frame_t%frame_set_line proc~truncate_to_width truncate_to_width proc~frame_set_line->proc~truncate_to_width proc~escape_length escape_length proc~truncate_to_width->proc~escape_length

Source Code

   subroutine frame_set_line(this, row, text)
      !! Set one line, truncated to the frame width in code points.
      !!
      !! A row outside the frame is ignored rather than an error: a caller
      !! drawing a list longer than the terminal should not have to check
      !! every write.
      class(frame_t), intent(inout) :: this
      integer(default_int), intent(in) :: row
         !! One-based row.
      character(len=*), intent(in) :: text
         !! Text for the row.

      if (row < 1_default_int .or. row > this%rows) return
      this%current(row) = truncate_to_width(text, this%cols)
   end subroutine frame_set_line