Place flour, salt and baking powder into a bowl. Rub in lard and mix into a stiff paste with the water. Boil the onions in a little water until tender then strain.
Roll out half the pastry and line the pie dish with it. Place in the onions. Scatter cheese on top. Season with salt and pepper. Dot over butter. Add milk.
Roll out remaining pastry and fix to top of pie. Make 2 sharp cuts on the top of pie. Brush over with egg. Make 2 sharp cuts on top of pie. Brush over with egg. Bake at 180 degrees C for 20-25 minutes.