On Thu, Feb 14, 2013 at 6:51 AM, Justin Rosander
<[email protected]> wrote:
> Hi there,
>
> I'm trying to put together a midi controller featuring faders that would be
> assigned to different channels.  In exploring the use of an array to make a
> window full of sliders, I put the following together:
>
> for(x = 0; x < 12; x++) {
>
>     //add slider
>     sl[x] = elm_slider_add(win);
>
>     elm_slider_horizontal_set(sl[x], EINA_FALSE);
>     //pack at the end of the box
>     elm_box_pack_end(box, sl[x]);
>     evas_object_show(sl[x]);
>     //callback to function returning value
>     evas_object_smart_callback_add(sl[x], "changed", _changed_cb, NULL);
> }
Replace the NULL in the callback_add with a pointer to data. It will
be available as the first argument in the callback funcion as a void *
. If you don't need to reference any other data in the cb, you can
pass &sl[x]. Also, the second arg. in the cb is the first arg. in the
callback_add().
>
> What I'm trying to figure out is how I would differentiate one slider from
> another in a callback function?  For instance, when I move, say, "slider 1"
> as opposed to "slider 2".
>
> Any input is appreciated.
>
> Justin
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> enlightenment-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-users

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to