Melt the butter and sugar in a pan, then toss in the onions. Stir until well coated, then pour over the balsamic vinegar. Cook for 10 minutes in the pan, then transfer to an ovenproof dish, cooking at 200 °C/400F/gas 6 for 15-20 minutes. The cooking time will sweeten the flavour and lose the strength of the onion. Serve hot.