remove_view Subroutine

private subroutine remove_view(self, v)

Remove all instances of v from the window's views.

Type Bound

WindowProxy

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(inout) :: self
type(View), intent(in), target :: v

the view to remove


Source Code

    subroutine remove_view(self, v)
        class(WindowProxy), intent(inout) :: self
        type(View), intent(in), target :: v                 !! the view to remove
        integer :: k
        k = 1
        do while (k <= self%n_views)
            if (associated(self%views(k)%p, v)) then
                self%views(k:self%n_views-1) = self%views(k+1:self%n_views)
                self%n_views = self%n_views - 1
                if (self%current > k) self%current = self%current - 1
            else
                k = k + 1
            end if
        end do
        self%current = min(self%current, self%n_views)
        if (self%current == 0 .and. self%n_views > 0) self%current = 1
        if (associated(self%shown, v)) self%shown => null()
    end subroutine remove_view