Re: pointer scope issues



On Jul 11, Najati R Imam wrote:
> But it seems that
> whenever I call the callback the makes a new one (at the "clicked" of a button)
> it goes and makes the new one, sets it up right and advanced the current
> pointer (which I am passing as the user data in the callback) and then when it
> leaves it forgets it.
> 
> So it seems pretty obvious to me that the scope on my user data (current) isn't
> right but I can't find anything that should work more then what I have that
> doesn't segfault. Is there something funny with callbacks that I wouldn't know
> from plains old c/c++ scope?

[ For future reference, this is a list for the discussion of the
  development of gtk+ itself, not discussing or assisting with its use ]

Data passed in as part of a callback are little pieces of static data;
it doesn't change with each invocation of the callback.

I'm not convinced that your data structures are what you want, but
ignoring that for the moment, it sounds like you want to have a
pointer to the pointer that you're trying to change be your callback
data.

-Phil




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