Ah, this aligns with my comment here: SDL Event and UserEvent questions - #8 by straight-shoota
ColorSampler
is a class and self
is a reference to an instance. Thus it is already a pointer.
You can cast it to a different pointer type: ev.user.data1 = self.as(Void*)
.