Re: changin pixmap on mouse enter



> I put a pixmap on a button now on click of that
>button
> I want to change that pixmap and connect to another
> window of the application.Do anybody has solution for
>that.
>In doing that main problem I think I am facing is to
>pass my own arguments in the function
>on_button_clicked.As it has predefined arguments.

yes, just like all GTK+ signal handling functions. you have to gather
up the arguments into a struct, and pass a pointer to it when you
connect to the signal. hints:

	typedef struct {
	    int foo;
	    void *bar;
	    float baz;
        } MyStruct;

	MyStruct *ms = g_new (1, MyStruct);

	ms->foo = 1;
	ms->bar = ms;
	ms->baz = M_PI;

	gtk_signal_connect (GTK_OBJECT(button), "clicked",
			    (GtkSignalFunc) on_button_clicked,
			    (gpointer) ms);

        void on_button_clicked (GtkWidget *w, gpointer data)
	{
		MyStruct *ms = (MyStruct *) data;
		.... do something ...
        }

--p







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