how to use gtk_object_class_user_signal_new



How to use gtk_object_class_user_signal_new()?
I tried several times, but it doesn't work very fine.  Maybe some
parameter I
didn't set up right.

Such as I want to create a signal with a parameter guint.

So what I did is:

//create new signal
gtk_object_class_user_signal_new(klass,"user",GTK_RUN_FIRST,gtk_signal_default_marshaller,GTK_TYPE_NONE,1,GTK_TYPE_UINT);
	... ...

//in somewhere of my code, I setup callback
gtk_signal_connect(GTK_OBJECT(widget),"user",GTK_SIGNAL_FUNC(User_Process),NULL); 

//in somewhere of my code, I declare the call back function defination
void User_Process(GtkWidget *widget, guint *type,gpointer data)
{
     ....
}

//in somewhere, I sent out the signal:
m=5;
gtk_signal_emit_by_name(GTK_OBJECT(widget),"user",&m);


But what happened is:
the signal is successfully being sent and the call back function is
being called, but the m never passed to the call back function, which
means type=NULL.  So I wonder how I can pass the parameter of the signal
to the call back function

Could you give some examples?  maybe a simple example for GtkWindow?

David Benson wrote:

> Hello,
>
> Use
>
>         gtk_object_class_user_signal_new()
>
> and friends.  Sorry, I've written but haven't sent up the docs
> for this.
>
> > Hi, All,
> >             Is there a way to create a new signal for a existing
Widget?
> >
> >             Such as:  If I want to define a new signal, which is not
an
> > existing signal (defined in GTK) for a GtkWindow, and put call back
> > function for that.
> >              Is there a way to do that?
> >
> >                 If somebody knows, please tell me ASAP, thanks very
> > much!
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
/dev/null

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
/dev/null



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