The example in demos/gtkD/DemoMultithread/DemoMultithread.d uses a C linkage function to create an idle listener on the GTK main loop. Is there a more D way of putting delegates on the main loop callback queue?

The demo way requires global data to communicate which somehow seems wrong.