[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Sheflug] stupid C question
Can you post some of the code José? looks like you may have a stack-frame
(auto) variable being accessed out of scope, but I don't really have enough
info to go on.
R
-----Original Message-----
From: José Luis Gómez Dans [mailto:nospam [at] sheffield.ac.uk]
Sent: Friday, November 03, 2000 03:37
To: Sheflug
Subject: Re: [Sheflug] stupid C question
On Fri, Nov 03, 2000 at 02:03:19PM -0000, Ross Goodley wrote:
> *(int *)user_data = 9; ?
Nice'n easy :) Thanks both Ross and Alastair for the answer.
Now, more problems on the way... Let's assume that there's 3 functions
in here: interface,callback1 and callback2. In interface() I call
callback1 and callback2 with my pointer as per my previous message.
gtk_signal_connect (GTK_OBJECT (plot_ampl), "clicked",
GTK_SIGNAL_FUNC (callback1),
(gpointer)&my_int_var);
void callback1(GtkEditable *editable, gpointer user_data);
void callback2(GtkEditable *editable, gpointer user_data);
I want to make sure that callback1 updates the value of
my_int_var to something else. I then want this updated value to be used
by callback2. For a start, the value is defined as 1 in the interface()
function.
However, when an event makes the program go to callback1, the
value in the pointer is a rosy 0, instead of 1. Any changes that I might
make in callback1 are lost (in principle, I don't mind what value gets
to callback1).
Any clues?
José
--
José L Gómez Dans PhD student
Radar & Communications Group
Department of Electronic Engineering
University of Sheffield UK
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.