Heat the butter in a frying pan. Reduce the heat, add the onions, stir fry for approx. 10 mins. Add the sugar and briefly continue cooking. Pour in the wine, reduce for approx. 1 min. Add the stock and thyme, bring to the boil. Add the cornflour while stirring, cook for approx. 2 mins., season.