def format(win)
      win.win.attron(nc)
      yield
      win.win.attroff(nc)
    end
def format(win)
      win.win.attron(nc)
      yield
      win.win.attroff(nc)
    end
Encapsulates window operation in color pair attribute