RE: newbie: on the form of callbacks...



        Hi, 

        All seems ok.

        widget (in callback) will receive button as parameter (by ref) and 
        data will be initialized with "button 1" constant.

        The signal is known -> not necessary to give it and the name of
callback function (callback) is known -> no need to give again.

        Hope this helps.



-----Original Message-----
From: Cevat Ustun [mailto:ustun Glue umd edu]
Sent: Thursday 22 February 2001 06:59
To: gtk-app-devel-list gnome org
Subject: newbie: on the form of callbacks...


Below are two snippets taken from the "Upgraded hello world"
example in the tutorials. My question is:  the function 
"callback" is called with _one_ argument; a pointer to "button 1", 
whereas the callback function itself has _two_ arguments...
What's going on?  


gtk_signal_connect (GTK_OBJECT (button), "clicked",
                    GTK_SIGNAL_FUNC (callback),
                    (gpointer) "button 1");


void callback( GtkWidget *widget,
               gpointer   data )
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}


Thanks for any help, 

Cevat Ustun

**** DISCLAIMER **** 
"This e-mail and any attachments thereto may contain information 
which is confidential and/or protected by intellectual property 
rights and are intended for the sole use of the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, 
total or partial reproduction, communication or distribution in any form) 
by persons other than the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either 
by telephone or by e-mail and delete the material from any computer. 
Thank you for your cooperation."





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