There are two ways to do this, see some examples in the posts made by codemastr and Iori.