[Vala] Passing user data to a signal handler - it works, but is it right?


to remove a ClutterGst.VideoTexture which implements the (Clutter.Media
interface) from a stage upon the eos signal I came up with the following
solution. It works - but it looks a bit weird. Especially passing the
player two times within the closure - the first player is the
Clutter.Media interface, the second is the wanted VideoTexture. 

void on_eos (Clutter.Media m, void *player) {
        Clutter.Actor *vp = player;
        stage.remove_actor (vp);


player = new ClutterGst.VideoTexture;
player.eos.connect(() => {on_eos (player, player); });

Any suggestion how to change/improve this?


tomw <tomw ubilix com>

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