update graph draw in a thread

I am currently trying to update the GraphWidget in a thread (because the
topology, and plot properties change from time to time).

I put regenerate_surface() and queue_draw() in the thread, however, the
GraphWdiget will become dead..

Does anyone know a good way to update the drawing? thanks a lot!

Gtk+ and cairo are not thread safe like this! You need to call all
drawing commands from the same thread if they share some state.