Re: [gtk-list] Bizarre problem with callbacks



"Daniel J. Kressin" <kressd11@sol.acs.uwosh.edu> writes:

> In my current project (a dart game) I have a struct called dartsType and I
> have a variable of said type declared in main (the variable is named
> "darts").  I have several callbacks (2 connected to a drawing area, 1
> connected to a button) in which the userdata parameter is "&darts".  The
> problem is this:  &darts should be the same value in all four places (3
> callbacks and main).  In fact, though, it is the same in main and the two
> drawing area callbacks, but different in the button callback.  I have been
> looking at it for days now, and can't figure out why this is.  I've
> stripped code left and right, and have included a Makefile, to make
> examining the code as easy as possible.  
> 

the changePlayer function is conected to the clicked signal
which is not an event signal so it should be of type

gint changePlayer(GtkWidget *player_change, dartsType *darts)

and then &darts is the same in all callbacks;

Hubert



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