gsignal help



Hi,

I would be grateful for some help understanding a few
gsignal functions .. first of all, the "g_signal_new"
function.

I don't know the purpose of all the parameters - for
example, when I try to create a signal like this:

//constructor 
testComponent::testComponent()
{
//signal_receive_data is of type guint
signal_receive_data = g_signal_new(
                "receivedata", 
                G_TYPE_OBJECT, 
                G_SIGNAL_RUN_LAST,
                0, 
                NULL, 
                NULL, 
                NULL, 
                G_TYPE_NONE,
                0, 
                NULL);
}

I get a G_TYPE_IS_INSTANTIABLE assertion failure. 
This happens for any value I've tried for the second
parameter.  

Basically I want this testComponent class to send a
signal to interrupt gtk_main.  So what values do I
need to put in?  I am particularly confused about
these descriptions in the API docs:

1. second parameter: "the type this signal pertains
to. It will also pertain to types which are derived
from this type."  What do they mean 'pertains to'? 
The type that is sending or receiving the signal? 

2. fourth parameter: "  The offset of the function
pointer in the class structure for this type. Used to
invoke a class method generically."  What is the
purpose of invoking this function?  Does it belong to
the class which is sending the signal?

3. marshaller: where can I find a good reference on
how marshalling and closure work?

Any insight would be much appreciated!
Thanks
Marisa



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]