Re: gtk_signal_connect() and passing parameters
- From: Mazur Przemyslaw <shem_mazur yahoo com au>
- To: Darin Adler <darin bentspoon com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: gtk_signal_connect() and passing parameters
- Date: Wed, 16 May 2001 10:38:37 +1000 (EST)
There are two problems with the code you posted
here:
1) The button_press_event signal has an additional
parameter that you
are not including in the declaration of your
callback function.
2) It looks like you are passing in the pointer to
a local variable
(i).
I think that problem #1 is what's tripping you up.
Change your callback to:
void button1_callback(GtkWidget *widget,
GdkEventButton *button,
gpointer data)
{
g_print("i: %d\n", *((int *)data));
}
If i is a local variable, you have a separate
problem.
-- Darin
Darin,
It was problem #1 as you expected (i was not local, so
problem #2 was not the cause). Thank You so much. My
code now works as expected. I'm sure glad I joined
this mail list. :-)
shem_mazur yahoo com au
_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]