def set_current_canvas(canvas):
 canvas.context._do_CURRENT_command = True
 if (canvasses and (canvasses[(-1)]() is canvas)):
  return
 cc = [c() for c in canvasses if (c() is not None)]
 while (canvas in cc):
  cc.remove(canvas)
 cc.append(canvas)
 canvasses[:] = [weakref.ref(c) for c in cc]

def set_current_canvas ( canvas ) : canvas . context . _do_CURRENT_command = True if ( canvasses and ( canvasses [ ( - 1 ) ] ( ) is canvas ) ) : return cc = [ c ( ) for c in canvasses if ( c ( ) is not None ) ] while ( canvas in cc ) : cc . remove ( canvas ) cc . append ( canvas ) canvasses [ : ] = [ weakref . ref ( c ) for c in cc ]
make a canvas active .