Segregation effects in thin films