class_docstr: A collection of ModularPrograms that emulates the API of a single
  ModularProgram. 
  
  A single Visual is often drawn in many different ways--viewed under
  different transforms, with different clipping boundaries, or with different
  colors as in picking and anaglyph stereo. Each draw may require a different
  program. To simplify this process, MultiProgram exposes an API that looks
  very much like a single ModularProgram, but internally manages many
  programs.
docstr: Create a program and add it to this MultiProgram.
  
  It is the caller's responsibility to keep a reference to the returned 
  program.
  
  The *name* must be unique, but is otherwise arbitrary and used for 
  debugging purposes.
docstr_tok: ["Create","a","program","and","add","it","to","this","MultiProgram",".","It","is","the","caller","'s","responsibility","to","keep","a","reference","to","the","returned","program",".","The","*","name","*","must","be","unique",",","but","is","otherwise","arbitrary","and","used","for","debugging","purposes","."]
code: def add_program(self, name=None):
      """Create a program and add it to this MultiProgram.
  
      It is the caller's responsibility to keep a reference to the returned
      program.
  
      The *name* must be unique, but is otherwise arbitrary and used for
      debugging purposes.
      """
      if name is None:
          name = "program" + str(self._next_prog_id)
          self._next_prog_id += 1
  
      if name in self._programs:
          raise KeyError("Program named '%s' already exists." % name)
  
      # create a program and update it to look like the rest
      prog = ModularProgram(self._vcode, self._fcode, self._gcode)
      for key, val in self._set_items.items():
          prog[key] = val
      self.frag._new_program(prog)
      self.vert._new_program(prog)
      if self._geom is not None:
          self.geom._new_program(prog)
  
      self._programs[name] = prog
      return prog
  
imports: import weakref
  from .program import ModularProgram
label_desc: Use image node_id 2 for calling the MultiProgram obj's underlying member method code with example usage: obj.add_program(name) and returns: prog