Re: [gtk-list] Bizarre problem with callbacks



"Daniel J. Kressin" wrote:
> 
> 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.
> 
> I'd appreciate *anyone* taking a look to see if they can find what I'm
> doing wrong.  The relevant code is attached as a tarball that untars to a
> directory "test".
> 


You must remove the parameter "event" in definition (and declaration) of
function changePlayer.
This callback does not receive information about events. Only the widget and
user data.


Good luck,

	
	- José Miguel



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