code: func (p *Pages) RemovePage(name string) *Pages {
  	var isVisible bool
  	hasFocus := p.HasFocus()
  	for index, page := range p.pages {
  		if page.Name == name {
  			isVisible = page.Visible
  			p.pages = append(p.pages[:index], p.pages[index+1:]...)
  			if page.Visible && p.changed != nil {
  				p.changed()
  			}
  			break
  		}
  	}
  	if isVisible {
  		for index, page := range p.pages {
  			if index < len(p.pages)-1 {
  				if page.Visible {
  					break // There is a remaining visible page.
  				}
  			} else {
  				page.Visible = true // We need at least one visible page.
  			}
  		}
  	}
  	if hasFocus {
  		p.Focus(p.setFocus)
  	}
  	return p
  }
docs: // RemovePage removes the page with the given name. If that page was the only
  // visible page, visibility is assigned to the last page.