Question: I have used Signals and slots in Qt and I want to implement same stuff in GTK+. 

I have 2 threads in which I need to pass data. I have done it using signals and slots in Qt but now I have to implement this same stuff in GTK+ and C. How should I do it?

Answer: 
[Here](http://zetcode.com/tutorials/gtktutorial/gtkevents/)'s a general tutorial for the signal/event mechanism without threads.

When using threads, you'll have to make sure to

* init the Gtk main loop for threads by calling [g\_thread\_init()](http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-thread-init) **and** [gdk\_threads\_init()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#gdk-threads-init).
* use [gdk\_threads\_add\_idle()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#gdk-threads-add-idle) **or**
* use [GDK\_THREADS\_ENTER()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#GDK-THREADS-ENTER:CAPS) and [GDK\_THREADS\_LEAVE()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#GDK-THREADS-LEAVE:CAPS) in the callback (= event handler).

There are probably hundreds of tutorials for threading in Gdk out there, so I'll leave it at that.
GTK/GLib has its own [signal mechanism](http://library.gnome.org/devel/gtk-tutorial/2.17/x159.html).