tags:

views:

142

answers:

3

Hi everyone,

I have used Signals and slots in QT. and i want o 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?

Thanks,
PP.

A: 

GTK/GLib has its own signal mechanism.

Matthew Flaschen
Thanks, i have used it in QT... like from one thread i will emit and it will call function in another thread (both threads are in same process). so how do i archive it in GTK. what should i use instead of emit in GTK.
PP
A: 

Qt does some of its own stuff behind the scenes to make signal/slot connections threadsafe. The last I was working with GTKmm, that wasn't the case for GTK. That being the case, you'd probably have to do up your own, or (my recommendation) use boost if you can. If you do have to roll your own, you'll want to have an event posting/polling mechanism. They aren't overly complex, but are enough of a pain you should definitely prefer pre-built solutions.

Caleb Huitt - cjhuitt
A: 

Here's a general tutorial for the signal/event mechanism without threads.

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

There are probably hundreds of tutorials for threading in Gdk out there, so I'll leave it at that.

knipknap